Closed rny closed 3 months ago
v1.3.0 changes a lot of code. https://github.com/antchfx/xpath/commits/master/
The best way is give your xpath expression to cause CPU high, let me test it.
can you remove this code to disable caches and test again? https://github.com/antchfx/xpath/blob/4b4638b370e898a9d10709464b8cd460b7dcfd0c/xpath.go#L96
I noticed 1.3.1 removed that loop. I have tested these upgrades
go: upgraded github.com/antchfx/xmlquery v1.3.18 => v1.4.1
go: upgraded github.com/antchfx/xpath v1.2.5 => v1.3.1
the v1.3.1 CPU and memory is ok
I guess the high CPU is caused by the thread deadlock when application run in the multiple goroutines that reused cached expr object. so I removed those loop code. https://github.com/antchfx/htmlquery/issues/58
agree. our app use xpath inside go { } a lot.
after upgrade xpath v1.2.5 => v1.3.0 ( not change anything else) our app memory keep increasing until OOM and CPU keeps 100%
I found a new loop was added in func (t *NodeIterator) MoveNext() bool is it cause endless loop in some case?