All Benchmarks
Interface vs Direct Method Call — Go Benchmark
A benchmark to compare the performance of interface vs direct method calls in Go.
interfacestruct
This benchmark compares the performance of interface vs direct method calls in Go. Each benchmark creates a struct, containing a single method. It will then call the method on the struct, either directly or via an interface.
Compare atCPUs
1 CPU
Fastest
Interface Method CallSlowest
Direct Method Call32 CPUs
Fastest
Interface Method CallSlowest
Direct Method CallPerformance Comparison (lower is better)
CPU:
1
Interface Method Call
FastestThis benchmark calls the method on the struct via an interface.
CPU Scaling — Interface Method Call (lower is better)
2
Direct Method Call
SlowestThis benchmark calls the method on the struct directly.
CPU Scaling — Direct Method Call (lower is better)
Contributors