Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expvar: improve Map.addKey for large number of keys
The existing implementation has poor performance for large number of keys because it chooses to append the new key to the sorted keys array and sort the new array again. The improvement tries to utilize the sorted keys array by searching the index and doing an insertion if any. It also fixes an error that duplicate keys may be inserted in high concurrent scenes. Fixes #31414
- Loading branch information
Showing
2 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters