Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize the Ref class in src/core/primitives.js #10394

Merged
merged 1 commit into from
Dec 30, 2018

Commits on Dec 29, 2018

  1. Optimize the Ref class in src/core/primitives.js

    The `toString` method always creates two string objects (for the 'R'
    character and for the `num` concatenation) and in the worst case
    creates three string objects (one more for the `gen` concatenation).
    For the Tracemonkey paper alone, this resulted in 12000 string
    objects when scrolling from the top to the bottom of the document.
    Since this is a hot function, it's worth minimizing the number of string
    objects, especially for large documents, to reduce peak memory usage.
    
    This commit refactors the `toString` method to always create only one
    string object.
    timvandermeij committed Dec 29, 2018
    Configuration menu
    Copy the full SHA
    aad27ff View commit details
    Browse the repository at this point in the history