Skip to content

Performance of Object.defineProperties use in the CID class #200

@achingbrain

Description

@achingbrain

I'm doing some profiling to debug high CPU usage and Object.defineProperties takes up rather a lot of execution time:

image

There's an interesting post here where someone tries to optimise very similar usage, an interesting quote being:

there [is] basically no truly efficient way to make properties nonenumerable

Would it be so terrible to remove the Object.definedProperties invocation here?

If we absolutely must have some sort of no-you-cannot-access-them-don't-even-think-about-it-the-sky-will-fall-on-our-heads-type protection for these fields could we switch to using private class fields instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions