Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Issue 2228003: Use an array of pages for the large arrays.... (Closed)

Created:
10 years, 7 months ago by sra
Modified:
9 years, 7 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Use an array of pages for the large arrays. The large arrays of ints used by the suffix array code sometimes can't be allocated due to fragmented address space. Using an array of 'pages' lets the allocation be satisfied by many smaller allocations. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=48547

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 15

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+188 lines, -12 lines) Patch
M courgette/bsdiff_memory_unittest.cc View 2 3 4 5 6 3 chunks +36 lines, -0 lines 0 comments Download
M courgette/courgette.gyp View 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M courgette/third_party/bsdiff_create.cc View 1 2 3 4 5 6 7 chunks +27 lines, -12 lines 0 comments Download
A courgette/third_party/paged_array.h View 3 4 5 6 1 chunk +81 lines, -0 lines 0 comments Download
A courgette/third_party/paged_array_unittest.cc View 3 4 1 chunk +42 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
jar (doing other things)
I noticed one bug, and a few style nits that should be changed. You should ...
10 years, 7 months ago (2010-05-27 07:34:17 UTC) #1
sra1
Thanks for the review. I fixed most issues and added another unit test. http://codereview.chromium.org/2228003/diff/3001/4002 File ...
10 years, 7 months ago (2010-05-28 06:28:38 UTC) #2
jar (doing other things)
I'd still argue for the DCHECK. See notes below. Thanks for making the other changes. ...
10 years, 7 months ago (2010-05-28 06:45:06 UTC) #3
sra1
Thanks for the review. Sumbitted. http://codereview.chromium.org/2228003/diff/3001/4002 File courgette/third_party/bsdiff_create.cc (right): http://codereview.chromium.org/2228003/diff/3001/4002#newcode66 courgette/third_party/bsdiff_create.cc:66: size_t offset = i ...
10 years, 7 months ago (2010-05-29 00:50:28 UTC) #4
jar (doing other things)
http://codereview.chromium.org/2228003/diff/3001/4002 File courgette/third_party/bsdiff_create.cc (right): http://codereview.chromium.org/2228003/diff/3001/4002#newcode66 courgette/third_party/bsdiff_create.cc:66: size_t offset = i & (kPageSize - 1); Apparently ...
10 years, 7 months ago (2010-05-29 01:43:40 UTC) #5
sra1
10 years, 6 months ago (2010-05-30 00:38:24 UTC) #6
On 2010/05/29 01:43:40, jar wrote:
> http://codereview.chromium.org/2228003/diff/3001/4002
> File courgette/third_party/bsdiff_create.cc (right):
> 
> http://codereview.chromium.org/2228003/diff/3001/4002#newcode66
> courgette/third_party/bsdiff_create.cc:66: size_t offset = i & (kPageSize -
1);
> Apparently there are 3 distinct builds.
> a) Debug (DCHECK is active)
> b) Release (DHECK is dynamically controlled by command line)
> c) Official (DCHECK is removed completely)

Thanks for the clarification.  I was running the Release build, unware* that
this is not representative of the released product.
If I follow the instructions to do an 'Official' build, the DCHECK is completely
removed, which I verified by disassembling the .exe

*It is hard to tell that there is something better than 'Release' without tribal
knowledge.  The configuration is called 'Release' and the other options visible
in Visual studio are Debug and Purify, so I thought that Release was the most
optimized.  It would be helpful if Official build was another configuration that
co-existed with the others, but as it stands for Visual Studio development, you
have to exit VS, set environment variables, rebuild the .sln file and then do a
clean build of the 'Release' configuration.

> 
> Also note that the Official builds take about 3 hours of linker time to
> optimize.
> 
> Where did you run your benchmark?
> 
> 
> 
> 
> On 2010/05/29 00:50:28, sra1 wrote:
> > On 2010/05/28 06:45:06, jar wrote:
> > > hmmm... a DCHECK generates zero code in a production (optmizied) build, so
I
> > > suspect your assertion of a perf reduction is mistaken.
> > > 
> > > On 2010/05/28 06:28:38, sra1 wrote:
> > > > On 2010/05/27 07:34:18, jar wrote:
> > > > > At a minimum, consider adding:
> > > > > DCHECK_LE(page, page_count_);
> > > > > 
> > > > > You might even make it a CHECK().
> > > > 
> > > > I tried a DCHECK but it caused a 2x perf hit on optimized code.
> > > > 
> > > 
> > > 
> > 
> > I was surprised, but I measured 2x.
> > 
> > DCHECK(foo); expands to
> > 
> > while (false && (foo)) logging::LogMessage(__FILE__,__LINE).stream();
> > 
> > This expansion permits e.g. DCHECK(foo) << "ouch";
> > 
> > 
> > While eventually the compiler will eliminate the zero-trip while-loop, the
> > presence of the code in the function causes the compiler (VS2005, at least)
to
> > decide not to inline the function.  (LogMessage is a class, so there is a
> > temporary object 'allocation', the explicit constructor call and an implicit
> > paired destructor call. An apparent loop containing three function calls
makes
> > the inlining candidate look too big.)  Different command-line flags or a
> > different compiler might do better.
> >

Powered by Google App Engine
This is Rietveld 408576698