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

Thread safety option #7

Merged
merged 4 commits into from
Nov 4, 2024
Merged

Thread safety option #7

merged 4 commits into from
Nov 4, 2024

Conversation

myxo
Copy link
Owner

@myxo myxo commented Nov 4, 2024

No description provided.

This slows operation a bit, if you not using thread safe feature,
but not dramatically

```
goos: linux
goarch: amd64
pkg: github.com/myxo/gofs/memory_test
cpu: 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
                                │   old.txt    │               new.txt                │
                                │    sec/op    │    sec/op     vs base                │
InMemory/write_to_start_32-8      10.37n ±  4%   11.86n ± 13%  +14.42% (p=0.000 n=10)
InMemory/read_at_start_32-8       11.01n ±  9%   12.12n ±  4%  +10.13% (p=0.002 n=10)
InMemory/write_cont_32-8          15.68n ±  4%   17.60n ±  4%  +12.24% (p=0.000 n=10)
InMemory/read_cont_32-8           12.58n ±  8%   18.12n ±  8%  +44.02% (p=0.000 n=10)
InMemory/write_to_start_4096-8    47.00n ±  3%   51.26n ±  8%   +9.05% (p=0.003 n=10)
InMemory/read_at_start_4096-8     45.85n ±  3%   46.82n ±  3%        ~ (p=0.247 n=10)
InMemory/write_cont_4096-8        49.68n ±  7%   55.20n ±  4%  +11.12% (p=0.000 n=10)
InMemory/read_cont_4096-8         49.31n ± 20%   53.28n ±  5%   +8.04% (p=0.043 n=10)
InMemory/write_to_start_65536-8   1.511µ ±  7%   1.455µ ±  4%        ~ (p=0.225 n=10)
InMemory/read_at_start_65536-8    1.392µ ±  5%   1.435µ ±  8%   +3.05% (p=0.030 n=10)
InMemory/write_cont_65536-8       1.482µ ±  7%   1.520µ ±  6%        ~ (p=0.403 n=10)
InMemory/read_cont_65536-8        1.403µ ±  9%   1.465µ ±  4%        ~ (p=0.101 n=10)
InMemory/readDir-8                325.2n ±  2%   354.9n ±  8%   +9.12% (p=0.022 n=10)
InMemory/readDir_file-8           194.4n ± 10%   213.9n ±  3%  +10.03% (p=0.029 n=10)
geomean                           108.9n         119.0n         +9.30%

                                │    old.txt    │                new.txt                │
                                │      B/s      │      B/s       vs base                │
InMemory/write_to_start_32-8      2.875Gi ±  4%   2.513Gi ± 11%  -12.61% (p=0.000 n=10)
InMemory/read_at_start_32-8       2.706Gi ±  9%   2.458Gi ±  4%   -9.16% (p=0.002 n=10)
InMemory/write_cont_32-8          1.901Gi ±  4%   1.693Gi ±  4%  -10.92% (p=0.000 n=10)
InMemory/read_cont_32-8           2.369Gi ±  9%   1.644Gi ±  9%  -30.59% (p=0.000 n=10)
InMemory/write_to_start_4096-8    81.16Gi ±  3%   74.44Gi ±  8%   -8.28% (p=0.003 n=10)
InMemory/read_at_start_4096-8     83.19Gi ±  3%   81.48Gi ±  3%        ~ (p=0.247 n=10)
InMemory/write_cont_4096-8        76.79Gi ±  7%   69.10Gi ±  3%  -10.01% (p=0.000 n=10)
InMemory/read_cont_4096-8         77.35Gi ± 17%   71.60Gi ±  5%   -7.44% (p=0.043 n=10)
InMemory/write_to_start_65536-8   40.40Gi ±  7%   41.95Gi ±  4%        ~ (p=0.218 n=10)
InMemory/read_at_start_65536-8    43.83Gi ±  4%   42.55Gi ±  7%   -2.93% (p=0.035 n=10)
InMemory/write_cont_65536-8       41.20Gi ±  6%   40.15Gi ±  7%        ~ (p=0.393 n=10)
InMemory/read_cont_65536-8        43.51Gi ±  8%   41.68Gi ±  4%        ~ (p=0.105 n=10)
geomean                           20.14Gi         18.44Gi         -8.47%

                                │   old.txt    │               new.txt               │
                                │     B/op     │    B/op     vs base                 │
InMemory/write_to_start_32-8      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/read_at_start_32-8       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/write_cont_32-8          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/read_cont_32-8           0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/write_to_start_4096-8    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/read_at_start_4096-8     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/write_cont_4096-8        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/read_cont_4096-8         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/write_to_start_65536-8   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/read_at_start_65536-8    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/write_cont_65536-8       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/read_cont_65536-8        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/readDir-8                200.0 ± 0%     216.0 ± 0%  +8.00% (p=0.000 n=10)
InMemory/readDir_file-8           88.00 ± 0%     88.00 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                      ²               +0.55%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                │   old.txt    │               new.txt               │
                                │  allocs/op   │ allocs/op   vs base                 │
InMemory/write_to_start_32-8      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/read_at_start_32-8       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/write_cont_32-8          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/read_cont_32-8           0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/write_to_start_4096-8    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/read_at_start_4096-8     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/write_cont_4096-8        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/read_cont_4096-8         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/write_to_start_65536-8   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/read_at_start_65536-8    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/write_cont_65536-8       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/read_cont_65536-8        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/readDir-8                5.000 ± 0%     5.000 ± 0%       ~ (p=1.000 n=10) ¹
InMemory/readDir_file-8           3.000 ± 0%     3.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                      ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

```
@myxo myxo merged commit dae9fd2 into master Nov 4, 2024
7 checks passed
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.

1 participant