Niel Drummond a écrit :
Justin Collins wrote:
There are two things in your code that probably contribute to it being slow: using recursion and creating a new string and copying the old one each time you add a character.


In my testing, this was about 80% faster.

Yes, thanks for the tip, though I'm still unhappy about the speed for these kind of I/O scripts on neko (perl is 6 times faster, surprisingly php is about the same speed as neko).

If you use the same "way" of reading data (temporary buffer) I/O speed depends entirely of the disk speed, and maybe disk cache (in case you run the perl script after the neko one). There is simply no way to have 6 times faster I/O by using "tricks" and I don't see how Neko could be 6 times slower since it uses the same C API as Perl does.

Nicolas

--
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to