-
-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use a strings.Replacer to reverse names in internal/abi
This way, rather than using a double loop quadratic algorithm to search for each name to replace in a string, we can make use of the reasonably efficient generic replacer which makes use of tries. I haven't measured whether this is noticeably better or worse than the previous implementation, and we don't have any benchmarks for it, but it should be reasonable to assume that a very basic double loop is going to be slower for the larger builds with thousands of names. Copying some code from the strings package is not ideal, but it beats having to re-implement such an algorithm ourselves.
- Loading branch information
Showing
1 changed file
with
266 additions
and
44 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