• Shenghou Ma's avatar
    runtime: use clock_gettime to get ns resolution for time.now & runtime.nanotime · 7777bac6
    Shenghou Ma authored
    For Linux/{386,arm}, FreeBSD/{386,amd64,arm}, NetBSD/{386,amd64}, OpenBSD/{386,amd64}.
    Note: our Darwin implementation already has ns resolution.
    
    Linux/386 (Core i7-2600 @ 3.40GHz, kernel 3.5.2-gentoo)
    benchmark       old ns/op    new ns/op    delta
    BenchmarkNow          110          118   +7.27%
    
    Linux/ARM (ARM Cortex-A8 @ 800MHz, kernel 2.6.32.28 android)
    benchmark       old ns/op    new ns/op    delta
    BenchmarkNow          625          542  -13.28%
    
    Linux/ARM (ARM Cortex-A9 @ 1GHz, Pandaboard)
    benchmark       old ns/op    new ns/op    delta
    BenchmarkNow          992          909   -8.37%
    
    FreeBSD 9-REL-p1/amd64 (Dell R610 Server with Xeon X5650 @ 2.67GHz)
    benchmark       old ns/op    new ns/op    delta
    BenchmarkNow          699          695   -0.57%
    
    FreeBSD 9-REL-p1/amd64 (Atom D525 @ 1.80GHz)
    benchmark       old ns/op    new ns/op    delta
    BenchmarkNow         1553         1658   +6.76%
    
    OpenBSD/amd64 (Dell E6410 with i5 CPU M 540 @ 2.53GHz)
    benchmark       old ns/op    new ns/op    delta
    BenchmarkNow         1262         1236   -2.06%
    
    OpenBSD/i386 (Asus eeePC 701 with Intel Celeron M 900MHz - locked to 631MHz)
    benchmark       old ns/op    new ns/op    delta
    BenchmarkNow         5089         5043   -0.90%
    
    NetBSD/i386 (VMware VM with Core i5 CPU @ 2.7GHz)
    benchmark       old ns/op    new ns/op    delta
    BenchmarkNow          277          278   +0.36%
    
    NetBSD/amd64 (VMware VM with Core i5 CPU @ 2.7Ghz)
    benchmark       old ns/op    new ns/op    delta
    BenchmarkNow          103          105   +1.94%
    
    Thanks Maxim Khitrov, Joel Sing, and Dave Cheney for providing benchmark data.
    
    R=jsing, dave, rsc
    CC=golang-dev
    https://golang.org/cl/6820120
    7777bac6
Name
Last commit
Last update
..
articles Loading commit data...
codewalk Loading commit data...
devel Loading commit data...
gopher Loading commit data...
play Loading commit data...
progs Loading commit data...
Makefile Loading commit data...
cmd.html Loading commit data...
code.html Loading commit data...
contrib.html Loading commit data...
contribute.html Loading commit data...
debugging_with_gdb.html Loading commit data...
docs.html Loading commit data...
effective_go.html Loading commit data...
gccgo_contribute.html Loading commit data...
gccgo_install.html Loading commit data...
go-logo-black.png Loading commit data...
go-logo-blue.png Loading commit data...
go-logo-white.png Loading commit data...
go1.1.html Loading commit data...
go1.html Loading commit data...
go1compat.html Loading commit data...
go_faq.html Loading commit data...
go_mem.html Loading commit data...
go_spec.html Loading commit data...
godocs.js Loading commit data...
help.html Loading commit data...
ie.css Loading commit data...
install-source.html Loading commit data...
install.html Loading commit data...
jquery.js Loading commit data...
logo-153x55.png Loading commit data...
reference.html Loading commit data...
root.html Loading commit data...
share.png Loading commit data...
sieve.gif Loading commit data...
style.css Loading commit data...
tos.html Loading commit data...