serpapi / nokolexbor

High-performance HTML5 parser for Ruby based on Lexbor, with support for both CSS selectors and XPath.
218 stars 4 forks source link

Optimize #at_css and #css initialization #14

Open zyc9012 opened 2 months ago

zyc9012 commented 2 months ago

Before

Nokolexbor at_css:   138765.3 i/s
Nokolexbor    css:    10132.0 i/s

After

Nokolexbor at_css:   202963.7 i/s
Nokolexbor    css:     10209.4 i/s
zyc9012 commented 2 months ago

Thanks @Freaky. I've removed all pthread stuff and made sure that it's thread-safe on truffleruby.