-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit speeds up `TSVector.String` by reusing exactly the same `strings.Builder` object for all parts of the TSVector. This commit also introduces a simple benchmark for this method. `benchstat` seems to be busted a bit, but the impact of this commit is: ``` │ /tmp/tmp.Unz2XLUFdB/bench.HEAD^^ │ /tmp/tmp.Unz2XLUFdB/bench.HEAD^ │ │ sec/op │ sec/op vs base │ TSVector/String-24 14.590m ± 0% 8.272m ± 0% -43.31% (p=0.000 n=10) TSVector/StringSize-24 14.654m ± 0% 8.269m ± 0% -43.57% (p=0.000 n=10) geomean 14.62m 8.270m -43.44% │ /tmp/tmp.Unz2XLUFdB/bench.HEAD^^ │ /tmp/tmp.Unz2XLUFdB/bench.HEAD^ │ │ B/op │ B/op vs base │ TSVector/String-24 4.516Mi ± 0% 2.319Mi ± 0% -48.65% (p=0.000 n=10) TSVector/StringSize-24 4.516Mi ± 0% 2.319Mi ± 0% -48.65% (p=0.000 n=10) geomean 4.516Mi 2.319Mi -48.65% │ /tmp/tmp.Unz2XLUFdB/bench.HEAD^^ │ /tmp/tmp.Unz2XLUFdB/bench.HEAD^ │ │ allocs/op │ allocs/op vs base │ TSVector/String-24 273.6k ± 0% 105.6k ± 0% -61.41% (p=0.000 n=10) TSVector/StringSize-24 273.6k ± 0% 105.6k ± 0% -61.41% (p=0.000 n=10) geomean 273.6k 105.6k -61.41% ``` Release note: None
- Loading branch information
1 parent
adb0556
commit 13d99ec
Showing
3 changed files
with
66 additions
and
35 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