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

Try to avoid the NanNew calls #4

Open
shama opened this issue Sep 30, 2014 · 0 comments
Open

Try to avoid the NanNew calls #4

shama opened this issue Sep 30, 2014 · 0 comments

Comments

@shama
Copy link
Owner

shama commented Sep 30, 2014

To make this faster, I would get rid of the calls to NanNew, which appears to be newing up strings so that it can pass a string like "change", "new" or delete to the listener. Newing up a string per event seems like a lot of overhead to me. I would instead pass back an enum or in other words, an integer (1=="change", 2="new", etc). Then, you don't have to new an object on the heap for every callback you need to make.

Thanks @Taytay for the tip :)

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

1 participant