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

Use Maps or WeakMaps instead of Objects for better V8 performance #656

Closed
Uzlopak opened this issue Nov 4, 2021 · 2 comments
Closed

Use Maps or WeakMaps instead of Objects for better V8 performance #656

Uzlopak opened this issue Nov 4, 2021 · 2 comments

Comments

@Uzlopak
Copy link
Contributor

Uzlopak commented Nov 4, 2021

I think we should implement LookupObject e.g. BaseChannel.consumers as Maps or WeakMaps instead of Objects. V8 creates for each shape of an Object a new V8-Class of that Object. So if you dynamically consume and cancel queues V8 should become slower and slower. If we use Maps it should have not that effect.

@carlhoerberg
Copy link
Contributor

We do this in https://github.com/cloudamqp/amqp-client.js/ already

@cressie176
Copy link
Collaborator

published in amqplib@0.9.1 Thank you @Uzlopak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants