Skip to content

Don't recreate the class #57

@jimmywarting

Description

@jimmywarting

V8 is unable to optimize this class if it's reconstructing it everytime.

ut_metadata/index.js

Lines 12 to 13 in b871aca

module.exports = metadata => {
class utMetadata extends EventEmitter {

  • The class should be moved to the top level.
  • A wire.ut_metadata instanceof check should work

Maybe should just get rid of the option to do: utMetadata(x) and instead use the wire.ut_metadata.setMetadata(x) method instead...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions