-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy net.ParseIP and modify to save memory allocations
Pass in a slice on the stack instead of allocating one on the heap: reduces garbage, hence makes the program run faster Also apply knowledge that critbitgo will do an append() with one extra byte, so we do that allocation up-front too. This is innocuous should we stop using critbitgo or should its internals change.
- Loading branch information
Showing
2 changed files
with
69 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