1. 18 Dec, 2012 3 commits
    • Shenghou Ma's avatar
      c0927a67
    • 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
    • David Symonds's avatar
      go/doc: add "hdr-" prefix to headers generated from package overviews. · 5b46fc41
      David Symonds authored
      R=golang-dev, bradfitz, gri
      CC=golang-dev
      https://golang.org/cl/6935071
      5b46fc41
  2. 17 Dec, 2012 24 commits
  3. 16 Dec, 2012 2 commits
  4. 15 Dec, 2012 2 commits
  5. 14 Dec, 2012 6 commits
  6. 13 Dec, 2012 3 commits
    • Ian Lance Taylor's avatar
      test: s/float/float32/ · cc5682dc
      Ian Lance Taylor authored
      I just committed a patch to gccgo that notices that float was
      never defined, causing an additional unmatched error message.
      Rename the type to avoid that message.
      
      R=golang-dev, minux.ma
      CC=golang-dev
      https://golang.org/cl/6947049
      cc5682dc
    • Nick Craig-Wood's avatar
      os: Improve the accuracy of os.Chtimes · 473441fc
      Nick Craig-Wood authored
      I've been writing some code which involves syncing files (like
      rsync) and it became apparent that under Linux I could read
      modification times (os.Lstat) with nanosecond precision but
      only write them with microsecond precision.  This difference
      in precision is rather annoying when trying to discover
      whether files need syncing or not!
      
      I've patched syscall and os to increases the accuracy of of
      os.Chtimes for Linux and Windows.  This involved exposing the
      utimensat system call under Linux and a bit of extra code
      under Windows.  I decided not to expose the "at" bit of the
      system call as it is impossible to replicate under Windows, so
      the patch adds syscall.Utimens() to all architectures along
      with a ImplementsUtimens flag.
      
      If the utimensat syscall isn't available (utimensat was added
      to Linux in 2.6.22, Released, 8 July 2007) then it silently
      falls back to the microsecond accuracy version it uses now.
      The improved accuracy for Windows should be good for all
      versions of Windows.
      
      Unfortunately Darwin doesn't seem to have a utimensat system
      call that I could find so I couldn't implement it there.  The
      BSDs do, but since they share their syscall implementation
      with Darwin I couldn't figure out how to define a syscall for
      *BSD and not Darwin.  I've left this as a TODO in the code.
      
      In the process I implemented the missing methods for Timespec
      under Windows which I needed which just happened to round out
      the Timespec API for all platforms!
      
      ------------------------------------------------------------
      
      Test code: http://play.golang.org/p/1xnGuYOi4b
      
      Linux Before (1000 ns precision)
      
      $ ./utimetest.linux.before z
      Setting mtime 1344937903123456789: 2012-08-14 10:51:43.123456789 +0100 BST
      Reading mtime 1344937903123457000: 2012-08-14 10:51:43.123457 +0100 BST
      
      Linux After (1 ns precision)
      
      $ ./utimetest.linux.after z
      Setting mtime 1344937903123456789: 2012-08-14 10:51:43.123456789 +0100 BST
      Reading mtime 1344937903123456789: 2012-08-14 10:51:43.123456789 +0100 BST
      
      Windows Before (1000 ns precision)
      
      X:\>utimetest.windows.before.exe c:\Test.txt
      Setting mtime 1344937903123456789: 2012-08-14 10:51:43.123456789 +0100 GMTDT
      Reading mtime 1344937903123456000: 2012-08-14 10:51:43.123456 +0100 GMTDT
      
      Windows After (100 ns precision)
      
      X:\>utimetest.windows.after.exe c:\Test.txt
      Setting mtime 1344937903123456789: 2012-08-14 10:51:43.123456789 +0100 GMTDT
      Reading mtime 1344937903123456700: 2012-08-14 10:51:43.1234567 +0100 GMTDT
      
      R=golang-dev, alex.brainman, rsc, bradfitz
      CC=golang-dev
      https://golang.org/cl/6905057
      473441fc
    • Brad Fitzpatrick's avatar
      A+C: Nick Craig-Wood (individual CLA) · 7b4bb048
      Brad Fitzpatrick authored
      Generated by addca.
      
      R=gobot
      CC=golang-dev
      https://golang.org/cl/6938051
      7b4bb048