Commit ada0018
Reuse a per-thread MD5 engine in CreateHash
Avoids allocating and initializing a fresh MD5CryptoServiceProvider on
every hash (the bulk-load hot path) by caching a [ThreadStatic] MD5
instance. MD5 is not thread-safe, so each thread keeps its own engine;
the produced digest is identical to before, so all triple/member IDs
are unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 0aef38c commit ada0018
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
| |||
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
48 | | - | |
49 | | - | |
| 56 | + | |
| 57 | + | |
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
| |||
0 commit comments