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

Slow member find #570

Closed
blackmanos opened this issue Mar 3, 2016 · 3 comments
Closed

Slow member find #570

blackmanos opened this issue Mar 3, 2016 · 3 comments

Comments

@blackmanos
Copy link

Hello
my test code
http://pastebin.com/Au1M3fzm
What am I doing wrong?
Find member very slow.

@andrusha97
Copy link
Contributor

Internally objects are just arrays of key-value pairs. So FindMember scans the array sequentially. Probably it's not supposed to be fast.

@pah
Copy link
Contributor

pah commented Mar 3, 2016

Try moving the random number generation out of the benchmarking loop. To me, it looks like this affects the measurement significantly.

@miloyip
Copy link
Collaborator

miloyip commented Mar 4, 2016

Memory query is currently, deliberately O(n), which is optimized for adding members instead of querying memory. See #102
For large data set, please convert the DOM to suitable data structure, or using SAX to build your own data structure.

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

4 participants