@@ -18,11 +18,13 @@ Zero-allocation Boxing is achieved by pooling Boxing objects in advance and reus
1818#### Result
1919| Process | Time |
2020| ---- | ---- |
21- | Boxing_Legacy | 34.47214 ms |
22- | Boxing_Pool | 17.515775 ms |
23- | Boxing_StructOnlyPool | 17.239465 ms |
24- | Boxing_ConcurrentPool | 17.70384 ms |
25- | Boxing_ConcurrentStructOnlyPool | 15.53006 ms |
21+ | Boxing_Legacy | 31.004235 ms |
22+ | Boxing_Pool | 15.1678 ms |
23+ | Boxing_StructOnlyPool | 15.358 ms |
24+ | Boxing_ConcurrentPool | 15.4086 ms |
25+ | Boxing_ConcurrentStructOnlyPool | 15.39855 ms |
26+ | Boxing_ThreadStaticPool | 15.19975 ms |
27+ | Boxing_ThreadStaticStructOnlyPool | 15.3461 ms |
2628
2729Using BoxingPool, the performance improvement is about 2x.
2830Also, allocation has been reduced to zero, and memory performance has been improved.
@@ -82,11 +84,13 @@ using (new Measure("Boxing_Pool", log))
8284#### Result
8385| Process | Mono | IL2CPP |
8486| ---- | ---- | ---- |
85- | Boxing_Legacy | 57.6889 ms | 35.61328 ms |
86- | Boxing_Pool | 8.582088 ms | 2.003906 ms |
87- | Boxing_StructOnlyPool | 8.450382 ms | 1.962891 ms |
88- | Boxing_ConcurrentPool | 9.024681 ms | 3.015625 ms |
89- | Boxing_ConcurrentStructOnlyPool | 8.934082 ms | 2.90625 ms |
87+ | Boxing_Legacy | 52.86654 ms | 41.43652 ms |
88+ | Boxing_Pool | 9.189175 ms | 2.425781 ms |
89+ | Boxing_StructOnlyPool | 9.142063 ms | 2.452148 ms |
90+ | Boxing_ConcurrentPool | 9.591019 ms | 3.321289 ms |
91+ | Boxing_ConcurrentStructOnlyPool | 9.610249 ms | 3.245117 ms |
92+ | Boxing_ThreadStaticPool | 9.15694 ms | 2.49707 ms |
93+ | Boxing_ThreadStaticStructOnlyPool | 9.292259 ms | 2.520508 ms |
9094
9195We saw a performance improvement of about 17x.
9296
0 commit comments