ipconv
is a package providing utility functions to convert ip with high performance.
Here is the benchmark with 2.4 GHz 8-Core Intel Core i9
:
$ GOMAXPROCS=1 go test -bench='Ipconv' -benchmem -benchtime=10s
Benchmark_Ipconv_V42Long 604734988 18.5 ns/op 0 B/op 0 allocs/op
Benchmark_Ipconv_Long2V4 803246886 15.0 ns/op 0 B/op 0 allocs/op