forked from golang/glog
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This simplifies the code. Instead of different instances, the package now maintains a global pool. This makes the text logger struct a bit smaller and thus cheaper to copy in the With* functions. Performance is about the same as before: name old time/op new time/op delta Header-36 1.68µs ± 7% 1.62µs ± 6% ~ (p=0.246 n=5+5) HeaderWithDir-36 1.63µs ± 6% 1.59µs ± 6% ~ (p=0.690 n=5+5) name old alloc/op new alloc/op delta Header-36 216B ± 0% 216B ± 0% ~ (all equal) HeaderWithDir-36 216B ± 0% 216B ± 0% ~ (all equal) name old allocs/op new allocs/op delta Header-36 2.00 ± 0% 2.00 ± 0% ~ (all equal) HeaderWithDir-36 2.00 ± 0% 2.00 ± 0% ~ (all equal) The text logger didn't actually return the buffer. Now it does.
- Loading branch information
Showing
4 changed files
with
32 additions
and
60 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
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