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

Voyeur performance issue #3

Closed
nevf opened this issue Aug 14, 2013 · 8 comments
Closed

Voyeur performance issue #3

nevf opened this issue Aug 14, 2013 · 8 comments

Comments

@nevf
Copy link

nevf commented Aug 14, 2013

@nbubna Thanks for forking voyeur.js. I'm curious to know whether you have done anything about the Voyeur performance issue.

@nbubna
Copy link
Owner

nbubna commented Aug 14, 2013

Yeah, read my comments on the issue and see the jsperf. Voyeur was defining things every time it touched a node. It was also not doing any caching of the filtered lists. Resolving both problems put the performance within reasonable margin of jQuery and better than Dojo. Further improvements could be made, but probably won't as i don't believe they are worth it. I explain that in the comments.

@nbubna nbubna closed this as completed Aug 14, 2013
@nevf
Copy link
Author

nevf commented Aug 15, 2013

@nbubna Where are the comments you refer to, I've not been able to find them. Link please.

@nbubna
Copy link
Owner

nbubna commented Aug 15, 2013

It's link at the end of the issue description above: adriancooney#20

Specifically: adriancooney#20 (comment)
http://jsperf.com/voyeur8000/5

@nevf
Copy link
Author

nevf commented Aug 15, 2013

@nbubna Thanks, got it. FYI the jsperf has an error:

Script error..

message: Script error.
fileName:
lineNumber: 0

and the HTML test displays 'ERROR'.

@nbubna
Copy link
Owner

nbubna commented Aug 15, 2013

Argh. Something in the page is using AMD, so the "all" version was failing when alter.js started looking for window.HTML. Universal module definition is a pain for a modular build. I'll have to rethink that...

@nbubna
Copy link
Owner

nbubna commented Aug 15, 2013

Here's a fixed version. http://jsperf.com/voyeur8000/11

This one is actually a better profile of HTML's performance, despite the slower result than before, because the latest version does peek into kids of the first element. So selecting an element with children is slightly slower than one without kids.

@nevf
Copy link
Author

nevf commented Aug 15, 2013

Thanks for the fix.

@jtenner
Copy link

jtenner commented Sep 25, 2013

I see the performance, and it's interesting to see that vanilla.js wins on performance.

Offsetting some of the searching by using getElementsByClassName is VERY fast.

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

No branches or pull requests

3 participants