#1116: Yet another String performance issue ----------------------------------+----------------------------------------- Reporter: yasuimao@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Another String performance issue. Tested on a text file with 4360 lines (\n). {{{ 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 }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1116> MacRuby <http://macruby.org/>