Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Inversion-des/40fa039a13f9f5ccd5b5f96c62bcfb54 to your computer and use it in GitHub Desktop.
Save Inversion-des/40fa039a13f9f5ccd5b5f96c62bcfb54 to your computer and use it in GitHub Desktop.
Pry session performance impact results on Windows
1.1) Normal
insert 500 (w:0) -- total: 0.207 s, item time = 0.413 ms ( 1.00x) (0.00)
insert 500 (w:1) -- total: 3.786 s, item time = 7.571 ms ( 1.00x) (0.00)
500 times find all -- total: 14.368 s, item time = 28.735 ms ( 1.00x) (0.00)
500 times find first (full) -- total: 5.316 s, item time = 10.632 ms ( 1.00x) (0.00)
500 times find first (full by id) -- total: 4.185 s, item time = 8.370 ms ( 1.00x) (0.00)
500 times find first (only name) -- total: 4.954 s, item time = 9.907 ms ( 1.00x) (0.00)
500 times count() -- total: 2.740 s, item time = 5.479 ms ( 1.00x) (0.00)
single find first (full) (0) -- total: 0.004 s, item time = 4.160 ms ( 1.00x) (0.00)
single find first (full) (1) -- total: 0.014 s, item time = 13.738 ms ( 1.00x) (0.00)
1.2) Normal again
insert 500 (w:0) -- total: 0.219 s, item time = 0.438 ms ( 1.06x) (+0.06)
insert 500 (w:1) -- total: 3.177 s, item time = 6.353 ms ( 0.84x) (-0.16)
500 times find all -- total: 14.641 s, item time = 29.282 ms ( 1.02x) (+0.02)
500 times find first (full) -- total: 5.602 s, item time = 11.204 ms ( 1.05x) (+0.05)
500 times find first (full by id) -- total: 4.292 s, item time = 8.585 ms ( 1.03x) (+0.03)
500 times find first (only name) -- total: 4.972 s, item time = 9.945 ms ( 1.00x) (+0.00)
500 times count() -- total: 3.629 s, item time = 7.258 ms ( 1.32x) (+0.32)
single find first (full) (0) -- total: 0.013 s, item time = 13.376 ms ( 3.22x) (+2.22)
single find first (full) (1) -- total: 0.012 s, item time = 12.337 ms ( 0.90x) (-0.10)
- Starting Pry...
Frame number: 0/6
113: Pry.hooks.add_hook(:before_session, 'show ex title') do |output, binding, pry|
114: $pry = pry
115: end
116:
117: binding.pry
=> 118: puts '- Pry finished'
119: end
120:
121: sleep 3
122: puts
123: puts
[1] pry(main)>
2) With active Pry session
insert 500 (w:0) -- total: 3.231 s, item time = 6.462 ms (15.64x) (+14.64)
insert 500 (w:1) -- total: 4.504 s, item time = 9.007 ms ( 1.19x) (+0.19)
500 times find all -- total: 123.703 s, item time = 247.405 ms ( 8.61x) (+7.61)
500 times find first (full) -- total: 26.399 s, item time = 52.798 ms ( 4.97x) (+3.97)
500 times find first (full by id) -- total: 6.457 s, item time = 12.915 ms ( 1.54x) (+0.54)
500 times find first (only name) -- total: 16.556 s, item time = 33.112 ms ( 3.34x) (+2.34)
500 times count() -- total: 4.762 s, item time = 9.523 ms ( 1.74x) (+0.74)
single find first (full) (0) -- total: 0.045 s, item time = 44.804 ms (10.77x) (+9.77)
single find first (full) (1) -- total: 0.047 s, item time = 46.685 ms ( 3.40x) (+2.40)
closing pry session
3) After closed Pry session
insert 500 (w:0) -- total: 0.320 s, item time = 0.640 ms ( 1.55x) (+0.55)
insert 500 (w:1) -- total: 0.533 s, item time = 1.066 ms ( 0.14x) (-0.86)
500 times find all -- total: 16.915 s, item time = 33.830 ms ( 1.18x) (+0.18)
500 times find first (full) -- total: 5.536 s, item time = 11.072 ms ( 1.04x) (+0.04)
500 times find first (full by id) -- total: 1.437 s, item time = 2.873 ms ( 0.34x) (-0.66)
500 times find first (only name) -- total: 5.305 s, item time = 10.609 ms ( 1.07x) (+0.07)
500 times count() -- total: 0.560 s, item time = 1.120 ms ( 0.20x) (-0.80)
single find first (full) (0) -- total: 0.005 s, item time = 4.902 ms ( 1.18x) (+0.18)
single find first (full) (1) -- total: 0.015 s, item time = 14.556 ms ( 1.06x) (+0.06)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment