排序的文本文件有超过亿条记录文本文件、过亿

2023-09-11 02:23:34 作者:映月读书

我有一个需要按照字母顺序进行排序一个5gig文本文件 什么是使用最好的算法?

I have a 5gig text file that needs to be sorted in alphabetical order What is the best algorithm to use?

约束:

速度 - 尽可能快

记忆 - 一个装有1千兆拉姆运行Windows XP

Memory - A Pc with 1 Gig Ram running windows XP

推荐答案

我经常文本文件> 2GB与排序 linux命令。通常需要15 - 30秒后​​,根据服务器的负载。

I routinely sort text files >2GB with the sort linux command. Usually takes 15 - 30 seconds, depending on server load.

只要做到这一点,它不会需要,只要你想。

Just do it, it won't take as long as you think.

更新由于您使用的是Windows XP,你可以在 sort命令UnxUtils 的。我使用的一个可能比Linux版本越多,它也同样快。

Update Since you're using Windows XP, you can get the sort command in UnxUtils. I use that one probably more than the linux version, and it's equally as fast.

对于大文件真的对磁盘速度的瓶颈问题..我的服务器上面有一个快速SATA RAID。如果你的机器是台式机或笔记本电脑,那么你的7200转(或5400)RPM IDE驱动器将在几分钟添加到作业。

The bottleneck for huge files really disk speed .. my server above has a fast sata raid. If your machine is a desktop (or laptop), then your 7200 RPM (or 5400) RPM IDE drives will add a few minutes to the job.

 
精彩推荐