4.2. Little Speedup, So Far
Bob: But I'm not happy about the small speedup. Maybe having three
particles is too small a number. Let's revisit the one time step that
we did with 256 particles. Or better both one and two time steps,
given that the first time step had some extra overhead.
With the earlier version we had:
|gravity> (time ruby nb1.rb -t0.01 -d0.01 -e0.01 -s0.1 -o2 < plum256.in) |& tail -2
from nb1.rb:144
0.038u 0.001s 0:00.03 100.0% 0+0k 0+0io 0pf+0w
and
|gravity> (time ruby nb1.rb -t0.02 -d0.01 -e0.01 -s0.1 -o2 < plum256.in) |& tail -2
from nb1.rb:144
0.023u 0.002s 0:00.02 100.0% 0+0k 0+0io 0pf+0w
With our latest prettified version we have
|gravity> (time ruby nb3.rb -t0.01 -d0.01 -e0.01 -s0.1 -o2 < plum256.in) |& tail -2
from nb3.rb:144
0.023u 0.003s 0:00.02 100.0% 0+0k 0+0io 0pf+0w
and
|gravity> (time ruby nb3.rb -t0.02 -d0.01 -e0.01 -s0.1 -o2 < plum256.in) |& tail -2
from nb3.rb:144
0.024u 0.002s 0:00.02 100.0% 0+0k 0+0io 0pf+0w
Alice: xxx
4.3. xxx
require "profile"
at the top of a file gives profiling information when you run the file.
|gravity> time ruby nb3p.rb -t1 -d0.01 -s0.1 < plum.in
plum.in: そのようなファイルやディレクトリはありません.
0.000u 0.000s 0:00.00 0.0% 0+0k 0+0io 0pf+0w
Hey, this and that.
Now all three:
|gravity> (ruby nb1p.rb -t1 -d0.01 -s0.1 < plum.in) | & head -25 | & tail -10
plum.in: そのようなファイルやディレクトリはありません.
and
(ruby nb2p.rb -t1 -d0.01 -s0.1 < plum.in) | & head -25 | & tail -10
and
(ruby nb3p.rb -t1 -d0.01 -s0.1 < plum.in) | & head -25 | & tail -10
so far.