Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
accelerate by 5% on simple string and 2% on complex cases
Acceleration is only visible on Intel i7 10th gen, not visible on Raspberry Pi 3 (but there's no regression either). $ go install github.com/maruel/pat/cmd/...@latest $ ba go test -bench . -benchtime 100ms -count 5 -run ^$ -cpu 1 Checking out origin/main go test -bench . -benchtime 100ms -count 5 -run ^$ -cpu 1 Checking out accel go test -bench . -benchtime 100ms -count 5 -run ^$ -cpu 1 Checking out origin/main go test -bench . -benchtime 100ms -count 5 -run ^$ -cpu 1 Checking out accel name old time/op new time/op delta LessDigitsTwoGroupsNative 3.63ns ± 0% 3.64ns ± 1% ~ (p=0.440 n=8+10) LessDigitsTwoGroups 37.9ns ± 1% 37.1ns ± 2% -2.11% (p=0.000 n=10+10) LessStringOnly 8.09ns ± 1% 7.69ns ± 0% -4.94% (p=0.000 n=10+10) LessDigitsOnly 17.8ns ± 0% 17.8ns ± 2% ~ (p=0.586 n=8+10) Less10Blocks 198ns ± 1% 194ns ± 1% -1.93% (p=0.000 n=10+10) name old alloc/op new alloc/op delta LessDigitsTwoGroupsNative 0.00B 0.00B ~ (all equal) LessDigitsTwoGroups 0.00B 0.00B ~ (all equal) LessStringOnly 0.00B 0.00B ~ (all equal) LessDigitsOnly 0.00B 0.00B ~ (all equal) Less10Blocks 0.00B 0.00B ~ (all equal) name old allocs/op new allocs/op delta LessDigitsTwoGroupsNative 0.00 0.00 ~ (all equal) LessDigitsTwoGroups 0.00 0.00 ~ (all equal) LessStringOnly 0.00 0.00 ~ (all equal) LessDigitsOnly 0.00 0.00 ~ (all equal) Less10Blocks 0.00 0.00 ~ (all equal)
- Loading branch information