You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
add built-in query object caching for reuse in the multiple queries with the same query string #16
htmlquery provides new methods QuerySelector and QuerySelectorAll, We can use compiled query object to reuse and avoid recompile the XPath query expression, this will shorter query speed time and improve application performance.
In fact, caching frequently used query objects can improve query performance. groupcache, I just caching Top N objects those the most frequent query object.
Activity
subsr97 commentedon Oct 27, 2019
@zhengchun
As I understand, you're suggesting to cache compiled XPath query expressions for use by
FindOneandFindmethods.But wouldn't the overhead of maintaining a cache be greater than the overhead caused by recompiling XPath queries?
zhengchun commentedon Oct 31, 2019
In fact, caching frequently used query objects can improve query performance. groupcache, I just caching Top N objects those the most frequent query object.
zhengchun commentedon Nov 9, 2019
https://github.com/antchfx/htmlquery/blob/master/query_test.go#L47
zhengchun commentedon Nov 11, 2019
# Add XPath selector object caching feature14e3905