Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(21)

Issue 9805043: code review 9805043: runtime: introduce helper persistentalloc() function (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by dvyukov
Modified:
12 years, 1 month ago
Reviewers:
DMorsing, dave, khr1
CC:
golang-dev, DMorsing, khr1
Visibility:
Public.

Description

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.

Patch Set 1 #

Patch Set 2 : diff -r 139919984600 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 3 : diff -r 139919984600 https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 1

Patch Set 4 : diff -r dba8aba7724c https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 5 : diff -r dba8aba7724c https://dvyukov%40google.com@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -25 lines) Patch
M src/pkg/runtime/malloc.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/malloc.goc View 1 2 3 1 chunk +47 lines, -0 lines 0 comments Download
M src/pkg/runtime/symtab.c View 1 6 chunks +7 lines, -25 lines 0 comments Download

Messages

Total messages: 8
dvyukov
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go/
12 years, 1 month ago (2013-05-27 09:33:37 UTC) #1
DMorsing
LGTM. https://codereview.appspot.com/9805043/diff/4001/src/pkg/runtime/malloc.goc File src/pkg/runtime/malloc.goc (right): https://codereview.appspot.com/9805043/diff/4001/src/pkg/runtime/malloc.goc#newcode507 src/pkg/runtime/malloc.goc:507: runtime·throw("persistentalloc: align is now a power of 2"); ...
12 years, 1 month ago (2013-05-27 14:20:26 UTC) #2
khr1
LGTM I'd define a second constant, PersistentAllocMaxBlock, and allocate directly above that size (instead of ...
12 years, 1 month ago (2013-05-27 21:35:17 UTC) #3
dvyukov
On Tue, May 28, 2013 at 1:35 AM, Keith Randall <khr@google.com> wrote: > LGTM > ...
12 years, 1 month ago (2013-05-28 04:01:47 UTC) #4
dvyukov
On 2013/05/28 04:01:47, dvyukov wrote: > On Tue, May 28, 2013 at 1:35 AM, Keith ...
12 years, 1 month ago (2013-05-28 06:47:18 UTC) #5
dvyukov
*** Submitted as https://code.google.com/p/go/source/detail?r=776aba85ece8 *** runtime: introduce helper persistentalloc() function It is a caching wrapper ...
12 years, 1 month ago (2013-05-28 06:47:51 UTC) #6
dave_cheney.net
On 2013/05/28 06:47:51, dvyukov wrote: > *** Submitted as https://code.google.com/p/go/source/detail?r=776aba85ece8 *** > > runtime: introduce ...
12 years, 1 month ago (2013-05-28 07:02:51 UTC) #7
dvyukov
12 years, 1 month ago (2013-05-28 07:14:18 UTC) #8
weird

undo cl:
https://codereview.appspot.com/9822043



On Tue, May 28, 2013 at 11:02 AM, <dave@cheney.net> wrote:

> On 2013/05/28 06:47:51, dvyukov wrote:
>
>> *** Submitted as
>>
>
https://code.google.com/p/go/**source/detail?r=776aba85ece8<https://code.goog...
>
>  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://codereview.appspot.**com/9805043<https://codereview.appspot.com/9805043>
>>
>
> This is causing build failures across all the amd64 builders. Please
> revert the change.
>
>
https://codereview.appspot.**com/9805043/<https://codereview.appspot.com/9805...
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b