Skip to content

Instantly share code, notes, and snippets.

@zenspider
Created December 11, 2023 21:37
Show Gist options
  • Save zenspider/b2e4369091ddc34fa1560c06d5d5fe91 to your computer and use it in GitHub Desktop.
Save zenspider/b2e4369091ddc34fa1560c06d5d5fe91 to your computer and use it in GitHub Desktop.

sudo nice -20

8710 % sudo nice -n -20 ./qb.rb
Calculating -------------------------------------
          caller_old     93.921k (± 0.4%) i/s -    473.433k in   5.040798s
          caller_new     95.918k (± 5.7%) i/s -    480.935k in   5.035228s
         caller_new2    104.619k (± 0.3%) i/s -    528.462k in   5.051375s
caller_locations_old    124.798k (± 0.2%) i/s -    625.185k in   5.009594s
caller_locations_new    125.252k (± 0.8%) i/s -    630.288k in   5.032480s
caller_locations_new2   140.866k (± 0.2%) i/s -    705.888k in   5.011073s

Comparison:
caller_locations_new2:  140866.4 i/s
caller_locations_new:   125251.5 i/s - 1.12x  slower
caller_locations_old:   124797.9 i/s - 1.13x  slower
         caller_new2:   104618.5 i/s - 1.35x  slower
          caller_new:    95918.2 i/s - 1.47x  slower
          caller_old:    93921.4 i/s - 1.50x  slower

sudo

8711 % sudo ./qb.rb
Calculating -------------------------------------
          caller_old     93.606k (± 0.3%) i/s -    474.657k in   5.070847s
          caller_new     95.126k (± 5.6%) i/s -    474.859k in   5.011993s
         caller_new2    104.199k (± 0.4%) i/s -    524.500k in   5.033729s
caller_locations_old    123.916k (± 0.3%) i/s -    623.538k in   5.031997s
caller_locations_new    125.204k (± 0.2%) i/s -    629.478k in   5.027620s
caller_locations_new2   140.525k (± 0.2%) i/s -    713.900k in   5.080255s

Comparison:
caller_locations_new2:  140525.2 i/s
caller_locations_new:   125204.3 i/s - 1.12x  slower
caller_locations_old:   123915.6 i/s - 1.13x  slower
         caller_new2:   104198.8 i/s - 1.35x  slower
          caller_new:    95125.7 i/s - 1.48x  slower
          caller_old:    93606.2 i/s - 1.50x  slower

normal

8712 % ./qb.rb
Calculating -------------------------------------
          caller_old     86.099k (± 0.4%) i/s -    434.418k in   5.045636s
          caller_new     89.616k (± 0.4%) i/s -    454.920k in   5.076385s
         caller_new2    102.316k (± 0.2%) i/s -    512.200k in   5.006094s
caller_locations_old     92.559k (± 0.2%) i/s -    466.294k in   5.037817s
caller_locations_new     93.041k (± 0.9%) i/s -    471.859k in   5.071993s
caller_locations_new2   112.693k (± 5.7%) i/s -    568.001k in   5.061197s

Comparison:
caller_locations_new2:  112692.8 i/s
         caller_new2:   102315.8 i/s - 1.10x  slower
caller_locations_new:    93040.5 i/s - 1.21x  slower
caller_locations_old:    92559.3 i/s - 1.22x  slower
          caller_new:    89616.3 i/s - 1.26x  slower
          caller_old:    86098.9 i/s - 1.31x  slower

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