Created
August 30, 2016 22:37
-
-
Save v-yarotsky/3dcf86ad408a8786d8ad2b22c1269780 to your computer and use it in GitHub Desktop.
Just stop using anonymous classes already
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/ips' | |
class A; end | |
foo = Class.new | |
Benchmark.ips do |t| | |
t.report("normal") { A.name } | |
t.report("anonymous") { foo.name } | |
end | |
__END__ | |
normal 4.361M (±18.4%) i/s - 20.631M | |
anonymous 1.291k (± 8.3%) i/s - 6.440k |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
😱