]> Cypherpunks repositories - gostls13.git/commit
runtime: introduce helper persistentalloc() function
authorDmitriy Vyukov <dvyukov@google.com>
Tue, 28 May 2013 06:47:35 +0000 (10:47 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Tue, 28 May 2013 06:47:35 +0000 (10:47 +0400)
commit47e0a3d7b12bbb12a513d7d1a4ebef8632a471ae
tree312aa096890ddda8ad23d0b4e9084336a87ff0b4
parent82ef961af59fdabc1a956ba6d7bc0c0b961172b2
runtime: introduce helper persistentalloc() function
It is a caching wrapper around SysAlloc() that can allocate small chunks.
Use it for symtab allocations. Reduces number of symtab walks from 4 to 3
(reduces buildfuncs time from 10ms to 7.5ms on a large binary,
reduces initial heap size by 680K on the same binary).
Also can be used for type info allocation, itab allocation.
There are also several places in GC where we do the same thing,
they can be changed to use persistentalloc().
Also can be used in FixAlloc, because each instance of FixAlloc allocates
in 128K regions, which is too eager.

R=golang-dev, daniel.morsing, khr
CC=golang-dev
https://golang.org/cl/9805043
src/pkg/runtime/malloc.goc
src/pkg/runtime/malloc.h
src/pkg/runtime/symtab.c