Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: optimize rgbColorValue #4

Merged
merged 1 commit into from Jun 9, 2021
Merged

all: optimize rgbColorValue #4

merged 1 commit into from Jun 9, 2021

Conversation

sbinet
Copy link
Contributor

@sbinet sbinet commented Jun 9, 2021

This CL introduces a per-document buffer to build color strings.

name        old time/op    new time/op    delta
RGB_grg-8      808ns ± 0%     576ns ± 0%  -28.66%  (p=0.000 n=17+18)
RGB_gray-8     779ns ± 0%     584ns ± 0%  -25.01%  (p=0.000 n=18+18)
RGB_full-8     746ns ± 1%     568ns ± 1%  -23.89%  (p=0.000 n=19+19)

name        old alloc/op   new alloc/op   delta
RGB_grg-8      64.0B ± 0%     24.0B ± 0%  -62.50%  (p=0.000 n=20+20)
RGB_gray-8     48.0B ± 0%     24.0B ± 0%  -50.00%  (p=0.000 n=20+20)
RGB_full-8     48.0B ± 0%     24.0B ± 0%  -50.00%  (p=0.000 n=20+20)

name        old allocs/op  new allocs/op  delta
RGB_grg-8       5.00 ± 0%      1.00 ± 0%  -80.00%  (p=0.000 n=20+20)
RGB_gray-8      4.00 ± 0%      1.00 ± 0%  -75.00%  (p=0.000 n=20+20)
RGB_full-8      4.00 ± 0%      1.00 ± 0%  -75.00%  (p=0.000 n=20+20)

This CL introduces a per-document buffer to build color strings.

```
name        old time/op    new time/op    delta
RGB_grg-8      808ns ± 0%     576ns ± 0%  -28.66%  (p=0.000 n=17+18)
RGB_gray-8     779ns ± 0%     584ns ± 0%  -25.01%  (p=0.000 n=18+18)
RGB_full-8     746ns ± 1%     568ns ± 1%  -23.89%  (p=0.000 n=19+19)

name        old alloc/op   new alloc/op   delta
RGB_grg-8      64.0B ± 0%     24.0B ± 0%  -62.50%  (p=0.000 n=20+20)
RGB_gray-8     48.0B ± 0%     24.0B ± 0%  -50.00%  (p=0.000 n=20+20)
RGB_full-8     48.0B ± 0%     24.0B ± 0%  -50.00%  (p=0.000 n=20+20)

name        old allocs/op  new allocs/op  delta
RGB_grg-8       5.00 ± 0%      1.00 ± 0%  -80.00%  (p=0.000 n=20+20)
RGB_gray-8      4.00 ± 0%      1.00 ± 0%  -75.00%  (p=0.000 n=20+20)
RGB_full-8      4.00 ± 0%      1.00 ± 0%  -75.00%  (p=0.000 n=20+20)
```
@sbinet sbinet merged commit e17835b into main Jun 9, 2021
@sbinet sbinet deleted the perf-rgb branch June 9, 2021 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant