Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
a = "hello"
1001.times {
a.byteslice(1) #=> "e"
a.byteslice(-1) #=> "o"
a.byteslice(1, 2) #=> "el"
}
sleep 5
t1 = Time.now
100000.times {
a.byteslice(1) #=> "e"
a.byteslice(-1) #=> "o"
a.byteslice(1, 2) #=> "el"
}
t2 = Time.now
delta = t2 - t1
puts "Done"
puts delta.to_s + " seconds"
[truffle] opt queued block in times:byteslice_test.rb:4 <split-0-U> |ASTSize 32/ 32 |Calls/Thres 1000/ 3 |CallsAndLoop/Thres 1000/ 1000 |Inval# 0
[truffle] opt start block in times:byteslice_test.rb:4 <split-0-U> |ASTSize 32/ 32 |Calls/Thres 1000/ 3 |CallsAndLoop/Thres 1000/ 1000 |Inval# 0
[truffle] opt queued String#byteslice(core):core: String#byteslice <split-0-U> |ASTSize 12/ 12 |Calls/Thres 1000/ 3 |CallsAndLoop/Thres 1000/ 1000 |Inval# 0
[truffle] opt queued String#byteslice(core):core: String#byteslice <split-1-U> |ASTSize 12/ 12 |Calls/Thres 1000/ 3 |CallsAndLoop/Thres 1000/ 1000 |Inval# 0
[truffle] opt queued String#byteslice(core):core: String#byteslice <split-2-U> |ASTSize 12/ 12 |Calls/Thres 1000/ 3 |CallsAndLoop/Thres 1000/ 1000 |Inval# 0
[truffle] opt done block in times:byteslice_test.rb:4 <opt> <split-0-U> |ASTSize 32/ 68 |Time 4356(2305+2052)ms |DirectCallNodes I 3/D 0 |GraalNodes 6765/15042 |CodeSize 64229 |Source byteslice_test.rb:4
[truffle] opt unqueued String#byteslice(core):core: String#byteslice <split-0-U> |SourceClass OptimizedDirectCallNode |Source OptimizedDirectCallNode(target=String#byteslice(core):core: String#byteslice <split-0-U>) |Reason Inlining caller compiled.
[truffle] opt unqueued String#byteslice(core):core: String#byteslice <split-1-U> |SourceClass OptimizedDirectCallNode |Source OptimizedDirectCallNode(target=String#byteslice(core):core: String#byteslice <split-1-U>) |Reason Inlining caller compiled.
[truffle] opt unqueued String#byteslice(core):core: String#byteslice <split-2-U> |SourceClass OptimizedDirectCallNode |Source OptimizedDirectCallNode(target=String#byteslice(core):core: String#byteslice <split-2-U>) |Reason Inlining caller compiled.
[truffle] opt queued block in times:byteslice_test.rb:14 <split-0-U> |ASTSize 32/ 32 |Calls/Thres 1000/ 3 |CallsAndLoop/Thres 1000/ 1000 |Inval# 0
[truffle] opt start block in times:byteslice_test.rb:14 <split-0-U> |ASTSize 32/ 32 |Calls/Thres 1000/ 3 |CallsAndLoop/Thres 1000/ 1000 |Inval# 0
[truffle] opt queued String#byteslice(core):core: String#byteslice <split-3-U> |ASTSize 12/ 12 |Calls/Thres 1000/ 3 |CallsAndLoop/Thres 1000/ 1000 |Inval# 0
[truffle] opt queued String#byteslice(core):core: String#byteslice <split-4-U> |ASTSize 12/ 12 |Calls/Thres 1000/ 3 |CallsAndLoop/Thres 1000/ 1000 |Inval# 0
[truffle] opt queued String#byteslice(core):core: String#byteslice <split-5-U> |ASTSize 12/ 12 |Calls/Thres 1000/ 3 |CallsAndLoop/Thres 1000/ 1000 |Inval# 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.