• Kirill Smelkov's avatar
    golang: Add benchmarks for chan, select, @func and defer · 3c55ca59
    Kirill Smelkov authored
    Start adding benchmarks to pygolang.
    
    Measure how much sync chan send/recv take and how much select takes for
    synchronous channels. Also measure how much overhead @func adds at both
    def and call times, and the overhead of defer compared to try/finally.
    For std (non-gevent'ed) Python2.7 we are currently at:
    
    	name         time/op
    	go           91.6µs ± 1%
    	chan         13.7µs ± 3%
    	select       30.1µs ± 4%
    	def          55.0ns ± 0%
    	func_def     43.6µs ± 0%
    	call         63.0ns ± 0%
    	func_call    1.06µs ± 0%
    	try_finally   136ns ± 1%
    	defer        2.33µs ± 0%
    3c55ca59
golang_test.py 18.8 KB