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

Issue 1129043: code review 1129043: re2: memory diet part 2 (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 10 months ago by rsc
Modified:
14 years, 10 months ago
Reviewers:
CC:
r, re2-dev_googlegroups.com
Visibility:
Public.

Description

re2: memory diet part 2 Change program representation from Inst* graph with forwarding pointers to contiguous array of Inst with forwarding indices. Cuts sizeof(Inst) from 24 to 8 bytes, fewer allocated objects, presumably better cache locality. The SparseArray<Inst*> would now be SparseArray<int> except that the instruction number was always the array index, so the value is redundant. Use SparseSets instead, saving 60% of the storage footprint due to SparseArrays. Convert all back ends to use new program representation. Free unused storage at end of IsOnePass (good for ~30%). Build with -DNDEBUG by default, to disable DCHECKs. Add obj/dbg/* target to Makefile to build in debug mode.

Patch Set 1 #

Patch Set 2 : code review 1129043: re2: memory diet part 2 #

Total comments: 2

Patch Set 3 : code review 1129043: re2: memory diet part 2 #

Patch Set 4 : code review 1129043: re2: memory diet part 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+717 lines, -865 lines) Patch
M Makefile View 6 chunks +38 lines, -5 lines 0 comments Download
M re2/bitstate.cc View 1 10 chunks +29 lines, -28 lines 0 comments Download
M re2/compile.cc View 22 chunks +210 lines, -148 lines 0 comments Download
M re2/dfa.cc View 1 30 chunks +73 lines, -67 lines 0 comments Download
M re2/nfa.cc View 1 22 chunks +47 lines, -45 lines 0 comments Download
M re2/onepass.cc View 1 15 chunks +37 lines, -27 lines 0 comments Download
M re2/prog.h View 7 chunks +106 lines, -91 lines 0 comments Download
M re2/prog.cc View 1 9 chunks +75 lines, -75 lines 0 comments Download
M re2/testing/backtrack.cc View 3 chunks +4 lines, -3 lines 0 comments Download
M util/sparse_set.h View 1 chunk +98 lines, -376 lines 0 comments Download

Messages

Total messages: 4
rsc
Hello r (cc: re2-dev@googlegroups.com), I'd like you to review this change.
14 years, 10 months ago (2010-05-10 00:32:45 UTC) #1
r
LGTM http://codereview.appspot.com/1129043/diff/2001/3008 File re2/prog.h (right): http://codereview.appspot.com/1129043/diff/2001/3008#newcode87 re2/prog.h:87: // Constructors per opcode are these really constructors? ...
14 years, 10 months ago (2010-05-10 16:33:10 UTC) #2
rsc
On Mon, May 10, 2010 at 09:33, <r@golang.org> wrote: > LGTM > http://codereview.appspot.com/1129043/diff/2001/3008#newcode87 > re2/prog.h:87: ...
14 years, 10 months ago (2010-05-10 22:40:37 UTC) #3
rsc
14 years, 10 months ago (2010-05-10 23:35:54 UTC) #4
*** Submitted as http://code.google.com/p/re2/source/detail?r=500fab9a75c6 ***

re2: memory diet part 2

Change program representation from Inst* graph
with forwarding pointers to contiguous array of Inst
with forwarding indices.  Cuts sizeof(Inst) from 24 to 8 bytes,
fewer allocated objects, presumably better cache locality.

The SparseArray<Inst*> would now be SparseArray<int>
except that the instruction number was always the array index,
so the value is redundant.  Use SparseSets instead, saving 60%
of the storage footprint due to SparseArrays.

Convert all back ends to use new program representation.

Free unused storage at end of IsOnePass (good for ~30%).

Build with -DNDEBUG by default, to disable DCHECKs.
Add obj/dbg/* target to Makefile to build in debug mode.

R=r
CC=re2-dev
http://codereview.appspot.com/1129043
Sign in to reply to this message.

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