Closed Bug 939603 Opened 11 years ago Closed 11 years ago

Add __slots__ support to JS objects

Categories

(Marketplace Graveyard :: Validation, defect)

Avenir
x86_64
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: basta, Unassigned)

Details

As it stands, every variable, identifier, and literal in every JS file in an app gets its own JS object, meaning thousands of objects are allocated for a medium-sized app. For large or extra large apps, that number could be in the millions (or, depending on how much ASM, billions).

I don't think any additional members are assigned at runtime, so we can safely add __slots__. This will dramatically improve memory usage when validating large apps and could conceivably decrease CPU churn by quite a bit as well.
https://github.com/mozilla/app-validator/commit/5b72803a59eee09bc025ac71205d92c08023edda
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.