1,332 karma · joined December 13, 2010
Rest in peace Bram.
time_ns = t[1].tv_nsec - t[0].tv_nsec + 1000000 * (t[1].tv_sec - t[0].tv_sec);
^^^^^^^ should be 1E9 instead $ seq -w 0001 0005|numfmt
1
2
3
4
5
Or just use plain sed: $ seq -w 0001 0005|sed 's/^0*//'
1
2
3
4
5I ran the comparison again on another machine that I have and this time their performances are about the same:
c++:
$ time ./tinykaboom
./tinykaboom 46.72s user 0.01s system 364% cpu 12.804 total
go: $ time ./tinykaboom
./tinykaboom 42.50s user 0.07s system 350% cpu 12.161 total $ time ./tinykaboom
./tinykaboom 78.08s user 0.02s system 369% cpu 21.159 total
Then I wondered how it would fare if I were to port it to Go and went ahead and hastily did port to Go and thought that, "hmmm this should run a bit slower than the c++ version" but surprisingly it ran more than twice faster: $ go build ./tinykaboom.go
$ time ./tinykaboom
./tinykaboom 34.32s user 0.03s system 368% cpu 9.315 total
https://github.com/holygeek/tinykaboom/blob/master/tinykaboo...Here's the corresponding perf report:
Go:
Samples: 103K of event 'cycles:pp', Event count (approx.): 37252033995665
Overhead Command Shared Object Symbol
32.17% tinykaboom tinykaboom [.] math.sin
28.80% tinykaboom tinykaboom [.] main.hash
11.81% tinykaboom tinykaboom [.] main.rotate
7.76% tinykaboom tinykaboom [.] math.Min
5.18% tinykaboom tinykaboom [.] main.lerpFloat64
4.25% tinykaboom tinykaboom [.] main.noise
2.59% tinykaboom tinykaboom [.] runtime.mallocgc
2.59% tinykaboom tinykaboom [.] main.fractal_brownian_motion
2.58% tinykaboom tinykaboom [.] main.signed_distance
c++: Samples: 234K of event 'cycles:pp', Event count (approx.): 86721459552303
Overhead Command Shared Object Symbol
67.93% tinykaboom libm-2.23.so [.] __sin_avx
30.80% tinykaboom tinykaboom [.] _Z5noiseRK3vecILm3EfE
1.27% tinykaboom libm-2.23.so [.] __floorf_sse41
0.00% tinykaboom tinykaboom [.] _Z23fractal_brownian_motionRK3vecILm3EfE
0.00% tinykaboom tinykaboom [.] floorf@plt
If anyone can give suggestions on how to make the tinykaboom.cpp faster that would be neat!Use numbers for dealing with files in git.
DEFUN ("atan", Fatan, Satan, 1, 2, 0,
Hah I couldn't read that with a straight face!One look at any of the assembly files and you can get a sense of how properly organized the source code is.
I pray that I won’t ever need to consider taking it though (passed one stone last year)
[1] https://en.wikipedia.org/wiki/Andy_Weir [2] https://en.wikipedia.org/wiki/The_Martian_(film)
command Tab1 set ts=1 sts=1 sw=1
command Tab2 set ts=2 sts=2 sw=2
command Tab4 set ts=4 sts=4 sw=4
command Tab8 set ts=8 sts=8 sw=8[1] https://www.joelonsoftware.com/2001/12/11/back-to-basics/
Source: https://git-scm.com/docs/gitk
Actual tcl source: https://github.com/git/git/blob/master/gitk-git/gitk