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

Issue 8659022: Puts JsScope on a diet (Closed)

Created:
9 years ago by zundel
Modified:
9 years ago
Reviewers:
mmendez, fabiomfv
CC:
reviews_dartlang.org, drfibonacci, srdjan
Visibility:
Public.

Description

Puts JsScope on a diet Lazy initialization of the names field and interning the description field reduces memory consumption from > 128M to < 64 M in a unit test that was suffering from OOM problems. Committed: https://code.google.com/p/dart/source/detail?r=1986

Patch Set 1 #

Patch Set 2 : Srdjan confirmed this fixes the OOM on Mac #

Patch Set 3 : Changed the strategy to only walk a specific class when TranslationContext is created #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -17 lines) Patch
M compiler/java/com/google/dart/compiler/backend/js/AbstractJsBackend.java View 1 2 4 chunks +7 lines, -4 lines 0 comments Download
M compiler/java/com/google/dart/compiler/backend/js/TranslationContext.java View 1 2 2 chunks +18 lines, -2 lines 0 comments Download
M compiler/java/com/google/dart/compiler/backend/js/ast/JsScope.java View 5 chunks +19 lines, -6 lines 0 comments Download
M compiler/scripts/dartc.sh View 1 2 1 chunk +10 lines, -1 line 0 comments Download
M compiler/scripts/dartc_test.sh View 1 2 1 chunk +7 lines, -1 line 0 comments Download
M tests/co19/co19-compiler.status View 1 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
zundel
http://codereview.chromium.org/8659022/diff/3/compiler/java/com/google/dart/compiler/backend/js/AbstractJsBackend.java File compiler/java/com/google/dart/compiler/backend/js/AbstractJsBackend.java (right): http://codereview.chromium.org/8659022/diff/3/compiler/java/com/google/dart/compiler/backend/js/AbstractJsBackend.java#newcode378 compiler/java/com/google/dart/compiler/backend/js/AbstractJsBackend.java:378: // on the heap when running some unit tests. ...
9 years ago (2011-11-29 15:03:05 UTC) #1
zundel
This change reduces the number of JsScope instances in the aforementioned test from 2,000,000 to ...
9 years ago (2011-11-29 16:51:59 UTC) #2
zundel
Ready for review - I think I am done changing my mind on this patch. ...
9 years ago (2011-11-29 19:21:55 UTC) #3
fabiomfv
IIRC we had removed interner due to compilation time. did you have the chance to ...
9 years ago (2011-11-29 19:34:53 UTC) #4
zundel
On 2011/11/29 19:34:53, fabiomfv wrote: > IIRC we had removed interner due to compilation time. ...
9 years ago (2011-11-29 19:45:48 UTC) #5
zundel
9 years ago (2011-11-29 19:59:51 UTC) #6
zundel
Rietveld ate my last comment. codefu and I briefly looked at the DartScanner memory usage ...
9 years ago (2011-11-29 20:01:55 UTC) #7
mmendez
9 years ago (2011-12-01 14:53:48 UTC) #8
LGTM

Part of the reason why we use multiple JsProgram's is to ensure proper ordering
between globals and other top level elements.  Using JsPrograms was just an
expedient solution at the time.

Overall, we spend a lot of time generating a JsAST to either produce a string,
which we write to a file, or to create a closure AST.  We need to ask ourselves
whether we really expect to implement optimizations like inlining, etc at the JS
level.  If we don't it may be simpler to just rip that stuff out and produce a
string.  That said, ripping it out would be a big change in and of itself so we
should see how the native support debate evolves.

Powered by Google App Engine
This is Rietveld 408576698