logicchains/ArrayAccessBench — pull request #6 by os6sense (2014-02-22 23:32:33+00:00)
Title: Faster Ruby Version

Your mileage may vary: Ruby 2.1 vs rbx 2.2.5 for Ruby.rb and Ruby1.rb. I suspect there is still a good bit of performance that could be rung out of this by someone more skilled.

~/Code_And_Programming/mmbm/ArrayAccessBench (master ✘)✚ ᐅ ruby Ruby1.rb
0 - duration 6361 ms
buyCost = 1823507753580007400000 sellCost = 1823507999999996300000
1 - duration 6092 ms
buyCost = 1823507753580007400000 sellCost = 1823507999999996300000
2 - duration 6078 ms
buyCost = 1823507753580007400000 sellCost = 1823507999999996300000
3 - duration 6081 ms
buyCost = 1823507753580007400000 sellCost = 1823507999999996300000
4 - duration 6072 ms
buyCost = 1823507753580007400000 sellCost = 1823507999999996300000
5 - duration 6091 ms
buyCost = 1823507753580007400000 sellCost = 1823507999999996300000
~/Code_And_Programming/mmbm/ArrayAccessBench (master ✘)✚ ᐅ ruby Ruby.rb
0 - duration 11162 ms
buyCost = 1823508246420007400000 sellCost = 1823507999999996300000
1 - duration 11007 ms
buyCost = 1823508246420007400000 sellCost = 1823507999999996300000
2 - duration 11243 ms
buyCost = 1823508246420007400000 sellCost = 1823507999999996300000
3 - duration 10645 ms
buyCost = 1823508246420007400000 sellCost = 1823507999999996300000
4 - duration 12491 ms
buyCost = 1823508246420007400000 sellCost = 1823507999999996300000
5 - duration 9395 ms
buyCost = 1823508246420007400000 sellCost = 1823507999999996300000
~/Code_And_Programming/mmbm/ArrayAccessBench (master ✘)✚ ᐅ /home/leej/Code_And_Programming/rubinius-2.2.5/bin/rbx Ruby1.rb
0 - duration 16957 ms
buyCost = 1823507753580007400000 sellCost = 1823507999999996300000
1 - duration 5878 ms
buyCost = 1823507753580007400000 sellCost = 1823507999999996300000
2 - duration 5907 ms
buyCost = 1823507753580007400000 sellCost = 1823507999999996300000
3 - duration 5876 ms
buyCost = 1823507753580007400000 sellCost = 1823507999999996300000
4 - duration 5894 ms
buyCost = 1823507753580007400000 sellCost = 1823507999999996300000
5 - duration 5881 ms
buyCost = 1823507753580007400000 sellCost = 1823507999999996300000
~/Code_And_Programming/mmbm/ArrayAccessBench (master ✘)✚ ᐅ /home/leej/Code_And_Programming/rubinius-2.2.5/bin/rbx Ruby.rb
0 - duration 47419 ms
buyCost = 1823508246420007400000 sellCost = 1823507999999996300000
1 - duration 31341 ms
buyCost = 1823508246420007400000 sellCost = 1823507999999996300000
2 - duration 26954 ms
buyCost = 1823508246420007400000 sellCost = 1823507999999996300000
3 - duration 14834 ms
buyCost = 1823508246420007400000 sellCost = 1823507999999996300000
4 - duration 31671 ms
buyCost = 1823508246420007400000 sellCost = 1823507999999996300000
5 - duration 14773 ms
buyCost = 1823508246420007400000 sellCost = 1823507999999996300000