Commit b6a619e
authored
[SYCL] Don't use
`ZSTDCompressor` holds `zstd` context as its only data members. The idea
behind `GetSingletonInstance()` method was to re-use these contexts for
subsequent compression and decompressions. Re-using context across
(de)compression reduces system memory usage.
However, `zstd` contexts are not meant to be used concurrently,
therefore, this PR makes `ZSTDCompressor` object thread-local, instead
of static.
Relevant excerpt from zstd doc
(https://facebook.github.io/zstd/zstd_manual.html):
> When decompressing many times,
> it is recommended to allocate a context only once,
> and re-use it for each successive compression operation.
> This will make workload friendlier for system's memory.
> Use one context per thread for parallel execution.zstd context across threads. (#19747)1 parent 367d5c1 commit b6a619e
File tree
2 files changed
+37
-1
lines changed- sycl
- source/detail
- unittests/compression
2 files changed
+37
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
0 commit comments