MatthewMueller/cheerio-soupselect — Issue #6: [Performance] :has() and :not() filters are slow 
Author: siddMahen
Created: 2012-01-17 21:58:52+00:00
State: open

I'm not particularly sure what I could do here to improve performance:

https://github.com/MatthewMueller/cheerio-soupselect/blob/master/lib/soupselect.js#L144
https://github.com/MatthewMueller/cheerio-soupselect/blob/master/lib/soupselect.js#L206

Any suggestions would be greatly appreciated.

Currently, the tests run `:not()` and `:has()` in approx. 144ms, which sucks.

```
✓ #select() should return [] when not present: 1ms
✓ #select() should return [] when requests are incorrectly formatted: 0ms
✓ #select() should return proper elements: 0ms
✓ #select() should return proper elements based on attribute selectors: 1ms
✓ #select() should return proper elements based on consecutive attribute selectors: 2ms
✓ #select() should return proper elements based on multiple attribute selectors: 0ms
✓ #select() should return proper elements based on multiple consecutive attribute selectors: 0ms
✓ #select() should return proper elements based on filter selector: 144ms // This is worrisome
✓ #select() should return proper elements based on nested filter selectors: 0ms
✓ #select() should return the outermost element when asked for it's id: 0ms

✔ 10 tests complete (157ms)
```