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
Bug#25418534: JSON_EXTRACT USING WILDCARDS TAKES FOREVER
Patch #2:
find_child_doms() checks for duplicates each time it adds a result to
the result vector. As explained in the header comment for
Json_wrapper::seek(), the duplicate elimination is needed for paths
which contain multiple ellipses, so in most cases it is unnecessary
work.
This patch makes find_child_doms() only check for duplicates in the
case where the path contains multiple ellipses, and only when
inspecting an ellipsis path leg which is not the first one.
Additionally:
Remove checks for empty vector after a successful call to push_back().
That is, replace checks for is_seek_done(result, only_need_one) with a
simple check for only_need_one when we know the result vector cannot
be empty.
Call is_seek_done() from the loop in Json_dom::seek() instead of at
the top of find_child_doms(), so that we can break out of the loop
earlier if we find a match and only need one.
Microbenchmarks (64-bit, Intel Core i7-4770 3.4 GHz, GCC 6.3):
BM_JsonDomSearchEllipsis 25693 ns/iter [+210.9%]
BM_JsonDomSearchEllipsis_OnlyOne 17881 ns/iter [+324.3%]
BM_JsonDomSearchKey 128 ns/iter [ +0.8%]
BM_JsonBinarySearchEllipsis 231319 ns/iter [ +38.7%]
BM_JsonBinarySearchEllipsis_OnlyOne 222726 ns/iter [ +41.6%]
BM_JsonBinarySearchKey 86 ns/iter [ 0.0%]
Change-Id: I0ee624830680247ec5aed302c0408db00240d441
0 commit comments