Commit cc9244b
committed
filter: lua: reduce allocation
Suppress one allocation, reducing their number from 5 to 4, by
pre-allocating the userdata we use to wrap the record passed to
the lua filter.
name old time/op new time/op delta
LUAProcess-8 638ns ± 4% 559ns ± 6% -12.31% (p=0.000 n=10+10)
name old alloc/op new alloc/op delta
LUAProcess-8 152B ± 0% 104B ± 0% -31.58% (p=0.000 n=10+10)
name old allocs/op new allocs/op delta
LUAProcess-8 5.00 ± 0% 4.00 ± 0% -20.00% (p=0.000 n=10+10)1 parent 7b1a1d7 commit cc9244b
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| 48 | + | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
| |||
56 | 62 | | |
57 | 63 | | |
58 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
59 | 68 | | |
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
63 | | - | |
| 72 | + | |
64 | 73 | | |
65 | 74 | | |
66 | 75 | | |
| |||
0 commit comments