• Rick Hudson's avatar
    runtime: Add prefetch to allocation code · 99482f2f
    Rick Hudson authored
    The routine mallocgc retrieves objects from freelists. Prefetch
    the object that will be returned in the next call to mallocgc.
    Experiments indicate that this produces a 1% improvement when using
    prefetchnta and less when using prefetcht0, prefetcht1, or prefetcht2.
    
    Benchmark numbers indicate a 1% improvement over no
    prefetch, much less over prefetcht0, prefetcht1, and prefetcht2.
    These numbers were for the garbage benchmark with MAXPROCS=4
    no prefetch                          >> 5.96 / 5.77 / 5.89
    prefetcht0(uintptr(v.ptr().next))    >> 5.88 / 6.17 / 5.84
    prefetcht1(uintptr(v.ptr().next))    >> 5.88 / 5.89 / 5.91
    prefetcht2(uintptr(v.ptr().next))    >> 5.87 / 6.47 / 5.92
    prefetchnta(uintptr(v.ptr().next))   >> 5.72 / 5.84 / 5.85
    
    Change-Id: I54e07172081cccb097d5b5ce8789d74daa055ed9
    Reviewed-on: https://go-review.googlesource.com/5350Reviewed-by: 's avatarDmitry Vyukov <dvyukov@google.com>
    Reviewed-by: 's avatarAustin Clements <austin@google.com>
    99482f2f
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...