[MacRuby-devel] Yet yet another String performance issue
Laurent Sansonetti
lsansonetti at apple.com
Sun Jan 16 19:36:05 PST 2011
Hi Yasu,
Thanks for reporting this. I believe the optimization we added for #gsub can also be used in #split. I see that you filed a ticket, we will follow up there.
Laurent
On Jan 16, 2011, at 10:12 AM, Yasu Imao wrote:
> Hi again,
>
> Another String performance issue. Tested on a text file with 4360 lines (\n) (different from the one I used with other tests). With these tests, 0.9 nightly is much much slower than 0.8, so I'll file a ticket for 0.9.
>
> Test 1 - File.read("test.txt").split(/\n/)
> Test 2 - File.read("test.txt").split("\n")
> Test 1 - force_encoding - File.read("test.txt").force_encoding("UTF-16BE").split(/\n/)
> Test 2 - force_encoding - File.read("test.txt").force_encoding("UTF-16BE").split("\n".force_encoding("UTF-16BE"))
>
> Test 3 - File.read("test.txt").lines {}
>
> Ruby 1.8.7
> Test 1 - 0.0081 0.0078 0.0086
> Test 2 - 0.0078 0.0079 0.0079
> Test 3 - 0.0058 0.0053 0.0065
>
> Ruby 1.9.2
> Test 1 - 0.0089 0.0090 0.0089
> Test 2 - 0.0035 0.0035 0.0035
> Test 3 - 0.0036 0.0035 0.0035
>
> MacRuby 0.8 2011/01/16
> Test 1 - 0.026 0.039 0.023
> Test 2 - 0.019 0.018 0.018
> Test 3 - 0.023 0.020 0.026
>
> MacRuby 0.9 2011/01/16
> Test 1 - 0.021 0.021 0.021
> Test 2 - 23.51 23.55 23.50
> Test 3 - 23.43 23.38 23.35
>
> MacRuby 0.9 2011/01/16 - force_encoding
> Test 1 - 0.015 0.015 0.015
> Test 2 - 0.011 0.011 0.011
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20110116/75cd0457/attachment.html>
More information about the MacRuby-devel
mailing list