Skip to content

Instantly share code, notes, and snippets.

@rickhull
Last active August 29, 2015 14:10
Show Gist options
  • Save rickhull/3925531c1e6ee2860ea6 to your computer and use it in GitHub Desktop.
Save rickhull/3925531c1e6ee2860ea6 to your computer and use it in GitHub Desktop.
ruby-prof output for `conway_deathmatch -s0 -n400 --silent`
Thread ID: 14553840
Fiber ID: 16483340
Total: 345.224791
Sort by: self_time
%self total self wait child calls name
17.34 101.392 59.853 0.000 41.539 22359774 Range#include?
16.32 246.807 56.332 0.000 190.475 11228000 ConwayDeathmatch::BoardState#alive?
12.03 41.539 41.539 0.000 0.000 44588115 Fixnum#<=>
10.93 139.138 37.746 0.000 101.392 11228007 ConwayDeathmatch::BoardState#in_bounds?
6.56 22.645 22.645 0.000 0.000 23783661 Array#[]
5.71 30.442 19.711 0.000 10.731 10964955 BasicObject#!=
3.11 10.739 10.739 0.000 0.000 10973388 String#==
2.65 290.996 9.144 0.000 281.852 1122800 ConwayDeathmatch::BoardState#neighbor_population
2.51 337.993 8.650 0.000 329.343 1122800 ConwayDeathmatch::BoardState#next_value
1.77 303.111 6.127 0.000 296.984 1122800 ConwayDeathmatch::BoardState#neighbor_stats
1.35 4.660 4.660 0.000 0.000 4857081 Fixnum#+
1.26 4.359 4.359 0.000 0.000 4491200 Fixnum#-
0.89 4.393 3.088 0.000 1.305 1122800 Enumerable#reduce
0.81 5.051 2.812 0.000 2.239 1151436 *Class#new
0.63 2.183 2.183 0.000 0.000 1122801 Hash#initialize
# using Range#cover? instead of Range#include?
Thread ID: 17298160
Fiber ID: 19226980
Total: 344.341443
Sort by: self_time
%self total self wait child calls name
17.45 100.732 60.089 0.000 40.643 22359774 Range#cover?
16.31 245.228 56.165 0.000 189.063 11228000 ConwayDeathmatch::BoardState#alive?
11.80 40.643 40.643 0.000 0.000 44588124 Fixnum#<=>
10.90 138.279 37.547 0.000 100.732 11228007 ConwayDeathmatch::BoardState#in_bounds?
6.53 22.495 22.495 0.000 0.000 23783661 Array#[]
5.64 30.018 19.428 0.000 10.589 10964955 BasicObject#!=
3.08 10.598 10.598 0.000 0.000 10973389 String#==
2.72 289.854 9.351 0.000 280.503 1122800 ConwayDeathmatch::BoardState#neighbor_population
2.52 336.963 8.685 0.000 328.278 1122800 ConwayDeathmatch::BoardState#next_value
1.79 302.080 6.161 0.000 295.919 1122800 ConwayDeathmatch::BoardState#neighbor_stats
1.32 4.537 4.537 0.000 0.000 4857081 Fixnum#+
1.28 4.404 4.404 0.000 0.000 4491200 Fixnum#-
0.89 4.416 3.080 0.000 1.336 1122800 Enumerable#reduce
0.82 5.220 2.815 0.000 2.404 1151436 *Class#new
0.68 2.349 2.349 0.000 0.000 1122801 Hash#initialize
# don't use ranges, just @xmax and @ymax, using potential_x.between?(0, @xmax - 1)
Thread ID: 13980420
Fiber ID: 15909040
Total: 381.467581
Sort by: self_time
%self total self wait child calls name
15.52 99.513 59.202 0.000 40.311 22359774 Comparable#between?
14.74 283.398 56.224 0.000 227.174 11228000 ConwayDeathmatch::BoardState#alive?
14.54 175.971 55.473 0.000 120.498 11228007 ConwayDeathmatch::BoardState#in_bounds?
10.57 40.311 40.311 0.000 0.000 44588124 Fixnum#<=>
6.63 25.286 25.286 0.000 0.000 26850974 Fixnum#-
5.82 22.211 22.211 0.000 0.000 23783661 Array#[]
5.19 30.809 19.786 0.000 11.023 10964955 BasicObject#!=
4.51 307.205 17.217 0.000 289.988 4491200 *Range#each
2.89 11.031 11.031 0.000 0.000 10973389 String#==
2.40 323.608 9.169 0.000 314.439 1122800 ConwayDeathmatch::BoardState#neighbor_population
2.25 374.173 8.602 0.000 365.571 1122800 ConwayDeathmatch::BoardState#next_value
1.60 335.546 6.102 0.000 329.444 1122800 ConwayDeathmatch::BoardState#neighbor_stats
1.22 4.673 4.673 0.000 0.000 4857081 Fixnum#+
0.79 4.320 3.008 0.000 1.312 1122800 Enumerable#reduce
0.72 5.095 2.762 0.000 2.333 1151436 *Class#new
0.60 2.278 2.278 0.000 0.000 1122801 Hash#initialize
# after minimizing bounds checks
Thread ID: 9507600
Fiber ID: 11367780
Total: 261.192918
Sort by: self_time
%self total self wait child calls name
15.97 88.027 41.720 0.000 46.307 9924750 ConwayDeathmatch::BoardState#alive?
8.69 192.725 22.701 0.000 170.025 4459120 *Range#each
7.75 20.238 20.238 0.000 0.000 21774117 Array#[]
6.92 27.889 18.081 0.000 9.808 9924761 BasicObject#!=
6.52 17.041 17.041 0.000 0.000 17850704 Fixnum#==
5.92 221.555 15.471 0.000 206.085 1122800 ConwayDeathmatch::BoardState#neighbor_population
4.86 12.703 12.703 0.000 0.000 13360518 Fixnum#>=
3.76 9.817 9.817 0.000 0.000 9933196 String#==
3.35 253.942 8.759 0.000 245.183 1122800 ConwayDeathmatch::BoardState#next_value
2.36 233.793 6.175 0.000 227.619 1122800 ConwayDeathmatch::BoardState#neighbor_stats
2.35 6.136 6.136 0.000 0.000 6601677 Fixnum#-
1.93 5.028 5.028 0.000 0.000 4860423 Fixnum#+
1.20 4.408 3.136 0.000 1.272 1122800 Enumerable#reduce
1.08 5.108 2.810 0.000 2.298 1151436 *Class#new
0.86 2.242 2.242 0.000 0.000 1122801 Hash#initialize
0.63 1.656 1.656 0.000 0.000 1122803 Hash#values
0.53 1.381 1.381 0.000 0.000 1122807 Array#[]=
# after minimizing calls to #alive?
Thread ID: 7795460
Fiber ID: 9598620
Total: 253.162652
Sort by: self_time
%self total self wait child calls name
8.98 182.990 22.737 0.000 160.254 4459120 *Range#each
8.18 20.714 20.714 0.000 0.000 20972349 Array#[]
6.78 17.174 17.174 0.000 0.000 18793777 Fixnum#==
6.10 211.576 15.439 0.000 196.137 1122800 ConwayDeathmatch::BoardState#neighbor_population
5.03 12.737 12.737 0.000 0.000 13360518 Fixnum#>=
4.93 12.477 12.477 0.000 0.000 13441838 Fixnum#+
4.15 10.517 10.516 0.000 0.001 8803004 Hash#[]
4.14 10.487 10.487 0.000 0.000 8802018 Hash#[]=
3.41 245.999 8.624 0.000 237.376 1122800 ConwayDeathmatch::BoardState#next_value
3.19 225.917 8.082 0.000 217.835 1122800 ConwayDeathmatch::BoardState#neighbor_stats
2.43 6.148 6.148 0.000 0.000 6601677 Fixnum#-
1.86 10.268 4.721 0.000 5.547 1122800 ConwayDeathmatch::BoardState#alive?
1.83 6.259 4.637 0.000 1.622 1122800 Hash#each
1.14 5.371 2.892 0.000 2.479 1151436 *Class#new
1.03 2.609 2.609 0.000 0.000 2434330 String#==
0.96 2.423 2.423 0.000 0.000 1122801 Hash#initialize
0.89 3.410 2.260 0.000 1.151 1122811 BasicObject#!=
0.53 1.331 1.331 0.000 0.000 1122807 Array#[]=
# after more #between
Thread ID: 3576580
Fiber ID: 4804380
Total: 237.727522
Sort by: self_time
%self total self wait child calls name
8.67 166.506 20.616 0.000 145.890 4459120 *Range#each
8.56 20.340 20.340 0.000 0.000 20807137 Array#[]
7.23 17.198 17.198 0.000 0.000 18680834 Fixnum#==
6.83 195.969 16.226 0.000 179.743 1122800 ConwayDeathmatch::BoardState#neighbor_population
5.16 12.259 12.259 0.000 0.000 13341201 Fixnum#+
4.40 10.458 10.458 0.000 0.000 8719412 Hash#[]=
4.08 9.705 9.704 0.000 0.001 8720398 Hash#[]
3.65 230.483 8.667 0.000 221.816 1122800 ConwayDeathmatch::BoardState#next_value
3.41 210.254 8.103 0.000 202.151 1122800 ConwayDeathmatch::BoardState#neighbor_stats
2.94 6.997 6.997 0.000 0.000 7544829 Fixnum#-
2.01 10.382 4.788 0.000 5.594 1122800 ConwayDeathmatch::BoardState#alive?
1.91 6.182 4.539 0.000 1.642 1122800 Hash#each
1.25 5.474 2.967 0.000 2.506 1151436 *Class#new
1.11 2.632 2.632 0.000 0.000 2416291 String#==
1.07 4.277 2.546 0.000 1.731 943166 Comparable#between?
1.03 2.450 2.450 0.000 0.000 1122801 Hash#initialize
0.94 3.370 2.233 0.000 1.137 1122811 BasicObject#!=
0.73 1.731 1.731 0.000 0.000 1786887 Fixnum#<=>
0.58 1.372 1.372 0.000 0.000 1122807 Array#[]=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment