Voyeur's performance is bad. It's so bad that Voyeur should never be used in production. It's manages just over 11,000 operations per second on it's most basic traversal in comparison to jQuery's 300,000 operations per second.
The problem is not something I can fix (without changing Voyeur's core values), it's got to do with Object.defineProperty's performance which is absolutely shit. Here is the performance difference of just setting the children's to a property on a node instead of an Object.defineProperty getter function. __defineGetter__ returns similar results.

The way I see it, I have two options.
- Change the syntax.
I feel the whole appeal of Voyeur is it's syntax. From the feedback I received, the ability to traverse the DOM like a Javascript object really seemed to resonate with developers so taking this option would defeat the purpose of Voyeur.
- Freeze the project until the performance is acceptable.
This may seem like a cop out but I can see no other option that will allow Voyeur to maintain it's uniqueness. I'm not the only one who has noticed the Object.defineProperty performance so I think putting the project on a halt until the various engine's catch up and the performance of Voyeur is satisfactory is the right way to go.
I'm going to go with option 2. I have left a visible warning on the README. Voyeur can be used for trivial projects and in the console but it should never used in production, under any circumstances.
I hope this message doesn't come across as spiteful or sour, that's completely unintentional. Sorry guys.
Comments and suggestions welcome!
Voyeur's performance is bad. It's so bad that Voyeur should never be used in production. It's manages just over 11,000 operations per second on it's most basic traversal in comparison to jQuery's 300,000 operations per second.
The problem is not something I can fix (without changing Voyeur's core values), it's got to do with
Object.defineProperty's performance which is absolutely shit. Here is the performance difference of just setting the children's to a property on a node instead of anObject.definePropertygetter function.__defineGetter__returns similar results.The way I see it, I have two options.
I feel the whole appeal of Voyeur is it's syntax. From the feedback I received, the ability to traverse the DOM like a Javascript object really seemed to resonate with developers so taking this option would defeat the purpose of Voyeur.
This may seem like a cop out but I can see no other option that will allow Voyeur to maintain it's uniqueness. I'm not the only one who has noticed the
Object.definePropertyperformance so I think putting the project on a halt until the various engine's catch up and the performance of Voyeur is satisfactory is the right way to go.I'm going to go with option 2. I have left a visible warning on the README. Voyeur can be used for trivial projects and in the console but it should never used in production, under any circumstances.
I hope this message doesn't come across as spiteful or sour, that's completely unintentional. Sorry guys.
Comments and suggestions welcome!