Skip to content

Instantly share code, notes, and snippets.

@iblue
Created November 13, 2013 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iblue/7451750 to your computer and use it in GitHub Desktop.
Save iblue/7451750 to your computer and use it in GitHub Desktop.
Maximum pwnage
def bar
GC.start
c = ObjectSpace.each_object() {}
puts "Objects definied: #{c}"
end
bar
10000.times do |i|
"sym_#{i}".to_sym
end
bar
10000.times do |i|
"sym_#{i}"
end
bar
@asaaki
Copy link

asaaki commented Nov 13, 2013

@iblue
Copy link
Author

iblue commented Nov 13, 2013

Ich dachte, die hätten es mittlerweile gefixt.

@asaaki
Copy link

asaaki commented Nov 13, 2013

Es gibt da nix zu fixen, da es ein Feature ist, dass Symbole in einer Hashmap gespeichert werden, damit man Zugriffe mit O(1) gewährleisten kann.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment