Commit 855563f
committed
Benchmark
The documentation state `Oj::Parser.usual` isn't thread safe:
https://github.com/ohler55/oj/blob/c70bf4125b546bc7146840b15de36460d42b4dff/ext/oj/parser.c#L1507-L1513
As such we shouldn't benchark it this way, but instantiate a new
parser every time. Technically in real world scenarios you could
create a pool of parsers and re-use them, but if it's not provided
by the gem, I'm not sure we should go out of our way to do it.Oj::Parser in a thread safe way1 parent b1397e2 commit 855563f
1 file changed
+1
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 31 | | |
36 | 32 | | |
37 | 33 | | |
| |||
0 commit comments