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
Chrome DevTools Profiler has identified JSZhuyinDataPackStorage#_getIncompleteMatchedSingleCodesInBlock as the top offender -- the for loop should be optimized if possible.
The text was updated successfully, but these errors were encountered:
The current approach can be found in no-linear-search branch. The commits removes the linear for loop when search each of the block (i.e. the _getIncompleteMatchedSingleCodesInBlock function stated on the title of the issue), and search all the partial matching sounds by generate a list of matched completed sounds first.
Unfortunately, per benchmark test, that actually makes it slower by ~35%.
The next thing to try would be try to reduce the list of completed sounds, since there are 4095 combinations yet in our database per my last investigation there are only around 1001 sounds exists. Implement that might reduce 76% of our call to the _searchBlock() functions.
B-tree probably won't help here since it only re-orders the values within the linear array, not actually change how we search things within it. But that could still be the next thing to try if the previous attempt proves unhelpful.
Chrome DevTools Profiler has identified
JSZhuyinDataPackStorage#_getIncompleteMatchedSingleCodesInBlock
as the top offender -- the for loop should be optimized if possible.The text was updated successfully, but these errors were encountered: