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

perf(proto): improve ColStr writing performance for small strings #428

Merged
merged 2 commits into from
Oct 9, 2024

Conversation

tdakkota
Copy link
Contributor

@tdakkota tdakkota commented Sep 26, 2024

goos: linux
goarch: amd64
pkg: github.com/ClickHouse/ch-go
cpu: AMD Ryzen 9 5950X 16-Core Processor            
                                  │    old.txt    │                new.txt                 │
                                  │    sec/op     │    sec/op      vs base                 │
Insert/SmallColStr/Rows10000-32     2903.0µ ±  4%    634.0µ ±  8%   -78.16% (p=0.000 n=15)
Insert/SmallColStr/Rows100000-32    28.549m ±  2%    2.584m ± 13%   -90.95% (p=0.000 n=15)
Insert/SmallColStr/Rows1000000-32   172.39m ±  2%    27.35m ±  2%   -84.14% (p=0.000 n=15)
Insert/BigColStr/Rows10000-32        25.97m ± 17%    33.78m ± 10%   +30.07% (p=0.000 n=15)
Insert/BigColStr/Rows100000-32       375.0m ± 11%   1051.0m ± 41%  +180.22% (p=0.000 n=15)
geomean                              20.52m          13.16m         -35.87%

                                  │    old.txt     │                 new.txt                  │
                                  │      B/s       │      B/s        vs base                  │
Insert/SmallColStr/Rows10000-32      55.85Mi ±  4%   255.73Mi ±  8%   +357.91% (p=0.000 n=15)
Insert/SmallColStr/Rows100000-32     56.79Mi ±  2%   627.37Mi ± 12%  +1004.70% (p=0.000 n=15)
Insert/SmallColStr/Rows1000000-32    94.04Mi ±  2%   592.83Mi ±  2%   +530.39% (p=0.000 n=15)
Insert/BigColStr/Rows10000-32        1.469Gi ± 15%    1.130Gi ± 11%    -23.12% (p=0.000 n=15)
Insert/BigColStr/Rows100000-32      1042.1Mi ± 10%    371.9Mi ± 70%    -64.31% (p=0.000 n=15)
geomean                              407.7Mi          635.8Mi          +55.93%

                                  │     old.txt     │                  new.txt                  │
                                  │      B/op       │      B/op        vs base                  │
Insert/SmallColStr/Rows10000-32      2085.57Ki ± 0%     11.14Ki ±  0%    -99.47% (p=0.000 n=15)
Insert/SmallColStr/Rows100000-32    23133.30Ki ± 0%     28.04Ki ±  4%    -99.88% (p=0.000 n=15)
Insert/SmallColStr/Rows1000000-32    234.485Mi ± 2%     2.458Mi ±  7%    -98.95% (p=0.000 n=15)
Insert/BigColStr/Rows10000-32          2.041Mi ± 0%     5.743Mi ± 12%   +181.31% (p=0.000 n=15)
Insert/BigColStr/Rows100000-32         24.32Mi ± 6%   2409.10Mi ± 50%  +9804.48% (p=0.000 n=15)
geomean                                402.6Ki          135.7Ki          -66.31%

                                  │  old.txt   │               new.txt               │
                                  │ allocs/op  │ allocs/op   vs base                 │
Insert/SmallColStr/Rows10000-32     335.0 ± 0%   327.0 ± 0%  -2.39% (p=0.000 n=15)
Insert/SmallColStr/Rows100000-32    343.0 ± 0%   328.0 ± 0%  -4.37% (p=0.000 n=15)
Insert/SmallColStr/Rows1000000-32   353.0 ± 1%   329.0 ± 0%  -6.80% (p=0.000 n=15)
Insert/BigColStr/Rows10000-32       335.0 ± 0%   329.0 ± 0%  -1.79% (p=0.000 n=15)
Insert/BigColStr/Rows100000-32      354.0 ± 1%   381.0 ± 7%  +7.63% (p=0.009 n=15)
geomean                             336.2        333.3       -0.87%

```
goos: linux
goarch: amd64
pkg: github.com/ClickHouse/ch-go
cpu: AMD Ryzen 9 5950X 16-Core Processor
                                  │    old.txt    │                new.txt                 │
                                  │    sec/op     │    sec/op      vs base                 │
Insert/SmallColStr/Rows10000-32     2903.0µ ±  4%    634.0µ ±  8%   -78.16% (p=0.000 n=15)
Insert/SmallColStr/Rows100000-32    28.549m ±  2%    2.584m ± 13%   -90.95% (p=0.000 n=15)
Insert/SmallColStr/Rows1000000-32   172.39m ±  2%    27.35m ±  2%   -84.14% (p=0.000 n=15)
Insert/BigColStr/Rows10000-32        25.97m ± 17%    33.78m ± 10%   +30.07% (p=0.000 n=15)
Insert/BigColStr/Rows100000-32       375.0m ± 11%   1051.0m ± 41%  +180.22% (p=0.000 n=15)
geomean                              20.52m          13.16m         -35.87%

                                  │    old.txt     │                 new.txt                  │
                                  │      B/s       │      B/s        vs base                  │
Insert/SmallColStr/Rows10000-32      55.85Mi ±  4%   255.73Mi ±  8%   +357.91% (p=0.000 n=15)
Insert/SmallColStr/Rows100000-32     56.79Mi ±  2%   627.37Mi ± 12%  +1004.70% (p=0.000 n=15)
Insert/SmallColStr/Rows1000000-32    94.04Mi ±  2%   592.83Mi ±  2%   +530.39% (p=0.000 n=15)
Insert/BigColStr/Rows10000-32        1.469Gi ± 15%    1.130Gi ± 11%    -23.12% (p=0.000 n=15)
Insert/BigColStr/Rows100000-32      1042.1Mi ± 10%    371.9Mi ± 70%    -64.31% (p=0.000 n=15)
geomean                              407.7Mi          635.8Mi          +55.93%

                                  │     old.txt     │                  new.txt                  │
                                  │      B/op       │      B/op        vs base                  │
Insert/SmallColStr/Rows10000-32      2085.57Ki ± 0%     11.14Ki ±  0%    -99.47% (p=0.000 n=15)
Insert/SmallColStr/Rows100000-32    23133.30Ki ± 0%     28.04Ki ±  4%    -99.88% (p=0.000 n=15)
Insert/SmallColStr/Rows1000000-32    234.485Mi ± 2%     2.458Mi ±  7%    -98.95% (p=0.000 n=15)
Insert/BigColStr/Rows10000-32          2.041Mi ± 0%     5.743Mi ± 12%   +181.31% (p=0.000 n=15)
Insert/BigColStr/Rows100000-32         24.32Mi ± 6%   2409.10Mi ± 50%  +9804.48% (p=0.000 n=15)
geomean                                402.6Ki          135.7Ki          -66.31%

                                  │  old.txt   │               new.txt               │
                                  │ allocs/op  │ allocs/op   vs base                 │
Insert/SmallColStr/Rows10000-32     335.0 ± 0%   327.0 ± 0%  -2.39% (p=0.000 n=15)
Insert/SmallColStr/Rows100000-32    343.0 ± 0%   328.0 ± 0%  -4.37% (p=0.000 n=15)
Insert/SmallColStr/Rows1000000-32   353.0 ± 1%   329.0 ± 0%  -6.80% (p=0.000 n=15)
Insert/BigColStr/Rows10000-32       335.0 ± 0%   329.0 ± 0%  -1.79% (p=0.000 n=15)
Insert/BigColStr/Rows100000-32      354.0 ± 1%   381.0 ± 7%  +7.63% (p=0.009 n=15)
geomean                             336.2        333.3       -0.87%
```
@tdakkota tdakkota marked this pull request as ready for review October 9, 2024 11:27
@ernado ernado merged commit 780d68d into ClickHouse:main Oct 9, 2024
25 checks passed
@tdakkota tdakkota deleted the perf/improve-colstr-writing branch October 9, 2024 17:57
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.

2 participants