Wednesday, September 10, 2014

Re: sorted file takes much longer to load

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On September 11, 2014 8:33:49 AM GMT+03:00, John Little <John.B.Little@gmail.com> wrote:
>I downloaded the file of 5,000,000 supposedly hacked gmail addresses
>(from http://rghost.net/57937836). I noticed something odd with vim:
>
>$ time vim -u NONE google_5000000.txt -c q
>
>real 0m3.212s
>user 0m2.971s
>sys 0m0.232s
>$ sort google_5000000.txt -o g2.txt
>$ time vim -u NONE g2.txt -c q
>
>real 0m54.808s
>user 0m54.379s
>sys 0m0.392s
>
>Why should the sorted file take 17 times longer to load?
>
>Regards, John Little
>
>--
>--
>You received this message from the "vim_use" maillist.
>Do not top-post! Type your reply below the text you are replying to.
>For more information, visit http://www.vim.org/maillist.php
>
>---
>You received this message because you are subscribed to the Google
>Groups "vim_use" group.
>To unsubscribe from this group and stop receiving emails from it, send
>an email to vim_use+unsubscribe@googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

Is this reproducible if you run vim multiple times in a row for each file separately? How many times this file may be duplicated in your free RAM?

I think this issue may be related to FS caches: sort requires reading the whole file into memory and has some overhead related to sorting, so it may just have forced FS caches to be dropped, while downloading this file has put it into the cache.
-----BEGIN PGP SIGNATURE-----
Version: APG v1.1.1

iQI1BAEBCgAfBQJUESmKGBxaeVggPHp5eC52aW1AZ21haWwuY29tPgAKCRCf3UKj
HhHSviejEACh7LNmQJik5pU09q8by8FabZfCf2ctJjg7hQPcdciDWRbmCU6c8XCq
APH1kgaW3Jq770IiSOQEWqMBC+Wqu+auHitGFMnjKkae0/KcnFeDYuNxn5+M3PbH
ZG25dtJ/KyUTmPnE4mJvgykcbamn6nxZfM+KWk29Z/yHIi4j48AA0/iFXkG2thn0
33AsqEvrzo0Fgy2P6spWPLSCIdOT9ha4C+qHU06S74N4D4qVraa2QZ3mNCLL0Ocy
FXfs1rpA/YpjaRtLkKxRmUbeP8yuar/nTxXsy+PFOybc8kYIpZuQIrticm99RntQ
tiEllPav6xJNSq2j588HVxp7E2CB4LQZ3NBAxpIkXsHoIQxaRL2SQ1Wb1jpOfGP+
qIBm92UU61l4dhf+ECFNoM5CnWP/y3scHoPb9m04NK+CMHMm3Sgkj5ctKERJgDQu
23HG83Eo4vUruIim+aV54jBqiXrSjveHgHyU4lkmZlYs8JA8Hvu2L0asha1hN047
iwa7iw1W0tAorgmVALhmRKt16LKF2A+hYSERDZ3jjJu0j8QABH6GkiFJEjWXELGh
+EaJYYbVKa81MAZfUsQ/Ti0gxOGLLH0g4MF7DotSc+UlewoyoyzuaxTSl7P2OPMa
RHvBBT0WrUPF+xa/HOKILk6a9DIFPgwlJyAAa+eWTuijVP+8UMUO+g==
=75KF
-----END PGP SIGNATURE-----

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: