Last active
February 1, 2016 22:04
-
-
Save RunsFor/1da01606f479ba75b08f to your computer and use it in GitHub Desktop.
jruby perform too slow comparing to mri
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'benchmark' | |
| objects = nil | |
| puts(Benchmark.measure do | |
| objects = 100_000.times.map { Object.new } | |
| block = proc { nil } | |
| objects.each { |obj| obj.define_singleton_method(:test_me, &block) } | |
| end) | |
| puts(Benchmark.measure do | |
| objects.each(&:test_me) | |
| end) |
RunsFor
commented
Feb 1, 2016
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment