Blog 2020/4/19
<- previous | index | next ->
I threw together a few trivial benchmarks to compare the rect filling performance of golang vs. python. The underlying SDL2 libraries are of course written in C, but I wanted to compare the overhead of the language bindings.
The performance is similar enough that it isn't a deciding factor in language choice.
Mid-2012 Macbook Pro, macOS:
cell@flouride(master)$ go run rectbench.go
1000 fills (fps): 67751.2
100 fills per update (fps): 13550.6
10 fills per update (fps): 2951.8
1 fill per update (fps): 262.7
cell@flouride(master)$ go run rectbench.go
1000 fills (fps): 67186.1
100 fills per update (fps): 14093.7
10 fills per update (fps): 3193.3
1 fill per update (fps): 245.0
cell@flouride(master)$ go run rectbench.go
1000 fills (fps): 67935.5
100 fills per update (fps): 11114.6
10 fills per update (fps): 2994.6
1 fill per update (fps): 269.3
cell@flouride(master)$ ./rectbench.py
1000 fills (fps): 36009.1
100 fills per update (fps): 12388.7
10 fills per update (fps): 2340.7
1 fill per update (fps): 307.2
cell@flouride(master)$ ./rectbench.py
1000 fills (fps): 35918.4
100 fills per update (fps): 10807.4
10 fills per update (fps): 2400.5
1 fill per update (fps): 285.5
cell@flouride(master)$ ./rectbench.py
1000 fills (fps): 34685.2
100 fills per update (fps): 11710.3
10 fills per update (fps): 2826.9
1 fill per update (fps): 294.2
HP ProBook 4530s, Linux:
cell@hp(master)$ ./rectbench.py
1000 fills (fps): 24023.3
100 fills per update (fps): 26091.9
10 fills per update (fps): 11327.5
1 fill per update (fps): 2255.1
cell@hp(master)$ ./rectbench.py
1000 fills (fps): 25701.3
100 fills per update (fps): 24788.9
10 fills per update (fps): 8994.3
1 fill per update (fps): 2392.3
cell@hp(master)$ ./rectbench.py
1000 fills (fps): 27946.9
100 fills per update (fps): 25059.9
10 fills per update (fps): 10226.5
1 fill per update (fps): 2332.7
cell@hp(master)$ go run rectbench.go
1000 fills (fps): 44600.8
100 fills per update (fps): 47399.3
10 fills per update (fps): 16091.7
1 fill per update (fps): 3480.6
cell@hp(master)$ go run rectbench.go
1000 fills (fps): 41921.4
100 fills per update (fps): 47761.1
10 fills per update (fps): 15688.6
1 fill per update (fps): 3061.9
cell@hp(master)$ go run rectbench.go
1000 fills (fps): 51489.0
100 fills per update (fps): 43015.8
10 fills per update (fps): 15517.8
1 fill per update (fps): 3354.9