Skip to content

Commit 62cadf8

Browse files
author
Oren (electricessence)
committed
Reintegrated.
1 parent bd52c73 commit 62cadf8

4 files changed

Lines changed: 109 additions & 294 deletions

File tree

benchmarking/BenchmarkResult.csv

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
Batch,Pool Type," From Empty (In Parallel)"," To (In Parallel)",d Read/Write (In Parallel),y Pool (.TryTake()),L,
2-
Repeat 200000 for size 4,QueueObjectPool,00:00:00.8414443,00:00:00.7491188,00:00:00.7633843,00:00:00.0939873,00:00:02.4479347,
3-
Repeat 200000 for size 4,ConcurrentQueueObjectPool,00:00:00.7907885,00:00:00.7635269,00:00:00.7739002,00:00:00.0956834,00:00:02.4238990,
4-
Repeat 200000 for size 4,OptimisticArrayObjectPool,00:00:00.8545861,00:00:00.7298007,00:00:00.7360451,00:00:00.0309048,00:00:02.3513367,
5-
Repeat 200000 for size 4,ChannelObjectPool,00:00:00.9057234,00:00:00.8273447,00:00:00.7409435,00:00:00.0901244,00:00:02.5641360,
6-
Repeat 80000 for size 10,QueueObjectPool,00:00:00.4912983,00:00:00.4533136,00:00:00.4291087,00:00:00.0878080,00:00:01.4615286,
7-
Repeat 80000 for size 10,ConcurrentQueueObjectPool,00:00:00.4694570,00:00:00.4624334,00:00:00.4517696,00:00:00.1010806,00:00:01.4847406,
8-
Repeat 80000 for size 10,OptimisticArrayObjectPool,00:00:00.5033997,00:00:00.3914612,00:00:00.4087611,00:00:00.0173492,00:00:01.3209712,
9-
Repeat 80000 for size 10,ChannelObjectPool,00:00:00.5184524,00:00:00.4868362,00:00:00.4049050,00:00:00.0772238,00:00:01.4874174,
10-
Repeat 24000 for size 50,QueueObjectPool,00:00:00.2166941,00:00:00.5193580,00:00:00.2609577,00:00:00.1199166,00:00:01.1169264,
11-
Repeat 24000 for size 50,ConcurrentQueueObjectPool,00:00:00.2071364,00:00:00.2237372,00:00:00.2196626,00:00:00.1443611,00:00:00.7948973,
12-
Repeat 24000 for size 50,OptimisticArrayObjectPool,00:00:00.3335099,00:00:00.1604842,00:00:00.1997833,00:00:00.0136419,00:00:00.7074193,
13-
Repeat 24000 for size 50,ChannelObjectPool,00:00:00.6503868,00:00:00.7734191,00:00:00.2313558,00:00:00.1015311,00:00:01.7566928,
14-
Repeat 16000 for size 100,QueueObjectPool,00:00:00.1955970,00:00:01.4124730,00:00:00.4856747,00:00:00.1556698,00:00:02.2494145,
15-
Repeat 16000 for size 100,ConcurrentQueueObjectPool,00:00:00.1850974,00:00:00.2225350,00:00:00.1948766,00:00:00.1859670,00:00:00.7884760,
16-
Repeat 16000 for size 100,OptimisticArrayObjectPool,00:00:00.4606833,00:00:00.1290964,00:00:00.2011276,00:00:00.0155033,00:00:00.8064106,
17-
Repeat 16000 for size 100,ChannelObjectPool,00:00:01.8300660,00:00:02.1177653,00:00:00.3798079,00:00:00.1307917,00:00:04.4584309,
18-
Repeat 25600 for size 250,QueueObjectPool,00:00:00.5207554,00:00:03.8471300,00:00:03.1776130,00:00:00.5699890,00:00:08.1154874,
19-
Repeat 25600 for size 250,ConcurrentQueueObjectPool,00:00:00.5144591,00:00:00.6581721,00:00:00.5638693,00:00:00.7343616,00:00:02.4708621,
20-
Repeat 25600 for size 250,OptimisticArrayObjectPool,00:00:03.0074967,00:00:00.3465589,00:00:00.7164117,00:00:00.0529356,00:00:04.1234029,
2+
Repeat 200000 for size 4,QueueObjectPool,00:00:00.8064961,00:00:00.7379976,00:00:00.7372226,00:00:00.0912138,00:00:02.3729301,
3+
Repeat 200000 for size 4,ConcurrentQueueObjectPool,00:00:00.8392163,00:00:00.8090963,00:00:00.8090662,00:00:00.1057385,00:00:02.5631173,
4+
Repeat 200000 for size 4,OptimisticArrayObjectPool,00:00:00.8582319,00:00:00.7316954,00:00:00.7462951,00:00:00.0322101,00:00:02.3684325,
5+
Repeat 80000 for size 10,QueueObjectPool,00:00:00.4891898,00:00:00.4641127,00:00:00.4325487,00:00:00.0887330,00:00:01.4745842,
6+
Repeat 80000 for size 10,ConcurrentQueueObjectPool,00:00:00.4774220,00:00:00.4532694,00:00:00.4577644,00:00:00.1030334,00:00:01.4914892,
7+
Repeat 80000 for size 10,OptimisticArrayObjectPool,00:00:00.5075819,00:00:00.3865528,00:00:00.4139942,00:00:00.0178275,00:00:01.3259564,
8+
Repeat 24000 for size 50,QueueObjectPool,00:00:00.2172210,00:00:00.4786407,00:00:00.2498973,00:00:00.1187320,00:00:01.0644910,
9+
Repeat 24000 for size 50,ConcurrentQueueObjectPool,00:00:00.2130298,00:00:00.2258805,00:00:00.2090524,00:00:00.1446890,00:00:00.7926517,
10+
Repeat 24000 for size 50,OptimisticArrayObjectPool,00:00:00.3218326,00:00:00.1749609,00:00:00.1948959,00:00:00.0136129,00:00:00.7053023,
11+
Repeat 16000 for size 100,QueueObjectPool,00:00:00.1933122,00:00:01.1807893,00:00:00.3700023,00:00:00.1532743,00:00:01.8973781,
12+
Repeat 16000 for size 100,ConcurrentQueueObjectPool,00:00:00.1885421,00:00:00.2231642,00:00:00.1945119,00:00:00.1892646,00:00:00.7954828,
13+
Repeat 16000 for size 100,OptimisticArrayObjectPool,00:00:00.4629300,00:00:00.1296838,00:00:00.2026568,00:00:00.0155329,00:00:00.8108035,
14+
Repeat 25600 for size 250,QueueObjectPool,00:00:00.5119740,00:00:03.6755755,00:00:03.0652345,00:00:00.5573299,00:00:07.8101139,
15+
Repeat 25600 for size 250,ConcurrentQueueObjectPool,00:00:00.5032784,00:00:00.6586173,00:00:00.5488527,00:00:00.7357870,00:00:02.4465354,
16+
Repeat 25600 for size 250,OptimisticArrayObjectPool,00:00:03.0809331,00:00:00.3488741,00:00:00.7180123,00:00:00.0531776,00:00:04.2009971,
17+
Repeat 9600 for size 1000,QueueObjectPool,00:00:00.4419158,00:00:02.4529980,00:00:02.3464286,00:00:00.6892199,00:00:05.9305623,
18+
Repeat 9600 for size 1000,ConcurrentQueueObjectPool,00:00:00.4453723,00:00:00.6651569,00:00:00.5769710,00:00:00.8922154,00:00:02.5797156,
19+
Repeat 9600 for size 1000,OptimisticArrayObjectPool,00:00:13.4891871,00:00:00.2492917,00:00:01.1461595,00:00:00.0718376,00:00:14.9564759,
20+
,OptimisticArrayObjectPool,00:00:03.0074967,00:00:00.3465589,00:00:00.7164117,00:00:00.0529356,00:00:04.1234029,
2121
Repeat 25600 for size 250,ChannelObjectPool,00:00:04.8289131,00:00:05.0525342,00:00:02.7992174,00:00:00.4744166,00:00:13.1550813,
2222
Repeat 9600 for size 1000,QueueObjectPool,00:00:00.4429800,00:00:02.5445855,00:00:02.5696949,00:00:00.7169192,00:00:06.2741796,
2323
Repeat 9600 for size 1000,ConcurrentQueueObjectPool,00:00:00.4447846,00:00:00.6793450,00:00:00.5848884,00:00:00.9255401,00:00:02.6345581,

benchmarking/BenchmarkResult.txt

Lines changed: 90 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -2,191 +2,149 @@ Repeat 200000 for size 4
22
------------------------------------
33

44
QueueObjectPool.........................................
5-
00:00:00.8414443 Take From Empty (In Parallel)
6-
00:00:00.7491188 Give To (In Parallel)
7-
00:00:00.7633843 Mixed Read/Write (In Parallel)
8-
00:00:00.0939873 Empty Pool (.TryTake())
9-
00:00:02.4479347 TOTAL
5+
00:00:00.8064961 Take From Empty (In Parallel)
6+
00:00:00.7379976 Give To (In Parallel)
7+
00:00:00.7372226 Mixed Read/Write (In Parallel)
8+
00:00:00.0912138 Empty Pool (.TryTake())
9+
00:00:02.3729301 TOTAL
1010

1111
ConcurrentQueueObjectPool...............................
12-
00:00:00.7907885 Take From Empty (In Parallel)
13-
00:00:00.7635269 Give To (In Parallel)
14-
00:00:00.7739002 Mixed Read/Write (In Parallel)
15-
00:00:00.0956834 Empty Pool (.TryTake())
16-
00:00:02.4238990 TOTAL
12+
00:00:00.8392163 Take From Empty (In Parallel)
13+
00:00:00.8090963 Give To (In Parallel)
14+
00:00:00.8090662 Mixed Read/Write (In Parallel)
15+
00:00:00.1057385 Empty Pool (.TryTake())
16+
00:00:02.5631173 TOTAL
1717

1818
OptimisticArrayObjectPool...............................
19-
00:00:00.8545861 Take From Empty (In Parallel)
20-
00:00:00.7298007 Give To (In Parallel)
21-
00:00:00.7360451 Mixed Read/Write (In Parallel)
22-
00:00:00.0309048 Empty Pool (.TryTake())
23-
00:00:02.3513367 TOTAL
24-
25-
ChannelObjectPool.......................................
26-
00:00:00.9057234 Take From Empty (In Parallel)
27-
00:00:00.8273447 Give To (In Parallel)
28-
00:00:00.7409435 Mixed Read/Write (In Parallel)
29-
00:00:00.0901244 Empty Pool (.TryTake())
30-
00:00:02.5641360 TOTAL
19+
00:00:00.8582319 Take From Empty (In Parallel)
20+
00:00:00.7316954 Give To (In Parallel)
21+
00:00:00.7462951 Mixed Read/Write (In Parallel)
22+
00:00:00.0322101 Empty Pool (.TryTake())
23+
00:00:02.3684325 TOTAL
3124

3225

3326
Repeat 80000 for size 10
3427
------------------------------------
3528

3629
QueueObjectPool.........................................
37-
00:00:00.4912983 Take From Empty (In Parallel)
38-
00:00:00.4533136 Give To (In Parallel)
39-
00:00:00.4291087 Mixed Read/Write (In Parallel)
40-
00:00:00.0878080 Empty Pool (.TryTake())
41-
00:00:01.4615286 TOTAL
30+
00:00:00.4891898 Take From Empty (In Parallel)
31+
00:00:00.4641127 Give To (In Parallel)
32+
00:00:00.4325487 Mixed Read/Write (In Parallel)
33+
00:00:00.0887330 Empty Pool (.TryTake())
34+
00:00:01.4745842 TOTAL
4235

4336
ConcurrentQueueObjectPool...............................
44-
00:00:00.4694570 Take From Empty (In Parallel)
45-
00:00:00.4624334 Give To (In Parallel)
46-
00:00:00.4517696 Mixed Read/Write (In Parallel)
47-
00:00:00.1010806 Empty Pool (.TryTake())
48-
00:00:01.4847406 TOTAL
37+
00:00:00.4774220 Take From Empty (In Parallel)
38+
00:00:00.4532694 Give To (In Parallel)
39+
00:00:00.4577644 Mixed Read/Write (In Parallel)
40+
00:00:00.1030334 Empty Pool (.TryTake())
41+
00:00:01.4914892 TOTAL
4942

5043
OptimisticArrayObjectPool...............................
51-
00:00:00.5033997 Take From Empty (In Parallel)
52-
00:00:00.3914612 Give To (In Parallel)
53-
00:00:00.4087611 Mixed Read/Write (In Parallel)
54-
00:00:00.0173492 Empty Pool (.TryTake())
55-
00:00:01.3209712 TOTAL
56-
57-
ChannelObjectPool.......................................
58-
00:00:00.5184524 Take From Empty (In Parallel)
59-
00:00:00.4868362 Give To (In Parallel)
60-
00:00:00.4049050 Mixed Read/Write (In Parallel)
61-
00:00:00.0772238 Empty Pool (.TryTake())
62-
00:00:01.4874174 TOTAL
44+
00:00:00.5075819 Take From Empty (In Parallel)
45+
00:00:00.3865528 Give To (In Parallel)
46+
00:00:00.4139942 Mixed Read/Write (In Parallel)
47+
00:00:00.0178275 Empty Pool (.TryTake())
48+
00:00:01.3259564 TOTAL
6349

6450

6551
Repeat 24000 for size 50
6652
------------------------------------
6753

6854
QueueObjectPool.........................................
69-
00:00:00.2166941 Take From Empty (In Parallel)
70-
00:00:00.5193580 Give To (In Parallel)
71-
00:00:00.2609577 Mixed Read/Write (In Parallel)
72-
00:00:00.1199166 Empty Pool (.TryTake())
73-
00:00:01.1169264 TOTAL
55+
00:00:00.2172210 Take From Empty (In Parallel)
56+
00:00:00.4786407 Give To (In Parallel)
57+
00:00:00.2498973 Mixed Read/Write (In Parallel)
58+
00:00:00.1187320 Empty Pool (.TryTake())
59+
00:00:01.0644910 TOTAL
7460

7561
ConcurrentQueueObjectPool...............................
76-
00:00:00.2071364 Take From Empty (In Parallel)
77-
00:00:00.2237372 Give To (In Parallel)
78-
00:00:00.2196626 Mixed Read/Write (In Parallel)
79-
00:00:00.1443611 Empty Pool (.TryTake())
80-
00:00:00.7948973 TOTAL
62+
00:00:00.2130298 Take From Empty (In Parallel)
63+
00:00:00.2258805 Give To (In Parallel)
64+
00:00:00.2090524 Mixed Read/Write (In Parallel)
65+
00:00:00.1446890 Empty Pool (.TryTake())
66+
00:00:00.7926517 TOTAL
8167

8268
OptimisticArrayObjectPool...............................
83-
00:00:00.3335099 Take From Empty (In Parallel)
84-
00:00:00.1604842 Give To (In Parallel)
85-
00:00:00.1997833 Mixed Read/Write (In Parallel)
86-
00:00:00.0136419 Empty Pool (.TryTake())
87-
00:00:00.7074193 TOTAL
88-
89-
ChannelObjectPool.......................................
90-
00:00:00.6503868 Take From Empty (In Parallel)
91-
00:00:00.7734191 Give To (In Parallel)
92-
00:00:00.2313558 Mixed Read/Write (In Parallel)
93-
00:00:00.1015311 Empty Pool (.TryTake())
94-
00:00:01.7566928 TOTAL
69+
00:00:00.3218326 Take From Empty (In Parallel)
70+
00:00:00.1749609 Give To (In Parallel)
71+
00:00:00.1948959 Mixed Read/Write (In Parallel)
72+
00:00:00.0136129 Empty Pool (.TryTake())
73+
00:00:00.7053023 TOTAL
9574

9675

9776
Repeat 16000 for size 100
9877
------------------------------------
9978

10079
QueueObjectPool.........................................
101-
00:00:00.1955970 Take From Empty (In Parallel)
102-
00:00:01.4124730 Give To (In Parallel)
103-
00:00:00.4856747 Mixed Read/Write (In Parallel)
104-
00:00:00.1556698 Empty Pool (.TryTake())
105-
00:00:02.2494145 TOTAL
80+
00:00:00.1933122 Take From Empty (In Parallel)
81+
00:00:01.1807893 Give To (In Parallel)
82+
00:00:00.3700023 Mixed Read/Write (In Parallel)
83+
00:00:00.1532743 Empty Pool (.TryTake())
84+
00:00:01.8973781 TOTAL
10685

10786
ConcurrentQueueObjectPool...............................
108-
00:00:00.1850974 Take From Empty (In Parallel)
109-
00:00:00.2225350 Give To (In Parallel)
110-
00:00:00.1948766 Mixed Read/Write (In Parallel)
111-
00:00:00.1859670 Empty Pool (.TryTake())
112-
00:00:00.7884760 TOTAL
87+
00:00:00.1885421 Take From Empty (In Parallel)
88+
00:00:00.2231642 Give To (In Parallel)
89+
00:00:00.1945119 Mixed Read/Write (In Parallel)
90+
00:00:00.1892646 Empty Pool (.TryTake())
91+
00:00:00.7954828 TOTAL
11392

11493
OptimisticArrayObjectPool...............................
115-
00:00:00.4606833 Take From Empty (In Parallel)
116-
00:00:00.1290964 Give To (In Parallel)
117-
00:00:00.2011276 Mixed Read/Write (In Parallel)
118-
00:00:00.0155033 Empty Pool (.TryTake())
119-
00:00:00.8064106 TOTAL
120-
121-
ChannelObjectPool.......................................
122-
00:00:01.8300660 Take From Empty (In Parallel)
123-
00:00:02.1177653 Give To (In Parallel)
124-
00:00:00.3798079 Mixed Read/Write (In Parallel)
125-
00:00:00.1307917 Empty Pool (.TryTake())
126-
00:00:04.4584309 TOTAL
94+
00:00:00.4629300 Take From Empty (In Parallel)
95+
00:00:00.1296838 Give To (In Parallel)
96+
00:00:00.2026568 Mixed Read/Write (In Parallel)
97+
00:00:00.0155329 Empty Pool (.TryTake())
98+
00:00:00.8108035 TOTAL
12799

128100

129101
Repeat 25600 for size 250
130102
------------------------------------
131103

132104
QueueObjectPool.........................................
133-
00:00:00.5207554 Take From Empty (In Parallel)
134-
00:00:03.8471300 Give To (In Parallel)
135-
00:00:03.1776130 Mixed Read/Write (In Parallel)
136-
00:00:00.5699890 Empty Pool (.TryTake())
137-
00:00:08.1154874 TOTAL
105+
00:00:00.5119740 Take From Empty (In Parallel)
106+
00:00:03.6755755 Give To (In Parallel)
107+
00:00:03.0652345 Mixed Read/Write (In Parallel)
108+
00:00:00.5573299 Empty Pool (.TryTake())
109+
00:00:07.8101139 TOTAL
138110

139111
ConcurrentQueueObjectPool...............................
140-
00:00:00.5144591 Take From Empty (In Parallel)
141-
00:00:00.6581721 Give To (In Parallel)
142-
00:00:00.5638693 Mixed Read/Write (In Parallel)
143-
00:00:00.7343616 Empty Pool (.TryTake())
144-
00:00:02.4708621 TOTAL
112+
00:00:00.5032784 Take From Empty (In Parallel)
113+
00:00:00.6586173 Give To (In Parallel)
114+
00:00:00.5488527 Mixed Read/Write (In Parallel)
115+
00:00:00.7357870 Empty Pool (.TryTake())
116+
00:00:02.4465354 TOTAL
145117

146118
OptimisticArrayObjectPool...............................
147-
00:00:03.0074967 Take From Empty (In Parallel)
148-
00:00:00.3465589 Give To (In Parallel)
149-
00:00:00.7164117 Mixed Read/Write (In Parallel)
150-
00:00:00.0529356 Empty Pool (.TryTake())
151-
00:00:04.1234029 TOTAL
152-
153-
ChannelObjectPool.......................................
154-
00:00:04.8289131 Take From Empty (In Parallel)
155-
00:00:05.0525342 Give To (In Parallel)
156-
00:00:02.7992174 Mixed Read/Write (In Parallel)
157-
00:00:00.4744166 Empty Pool (.TryTake())
158-
00:00:13.1550813 TOTAL
119+
00:00:03.0809331 Take From Empty (In Parallel)
120+
00:00:00.3488741 Give To (In Parallel)
121+
00:00:00.7180123 Mixed Read/Write (In Parallel)
122+
00:00:00.0531776 Empty Pool (.TryTake())
123+
00:00:04.2009971 TOTAL
159124

160125

161126
Repeat 9600 for size 1000
162127
------------------------------------
163128

164129
QueueObjectPool.........................................
165-
00:00:00.4429800 Take From Empty (In Parallel)
166-
00:00:02.5445855 Give To (In Parallel)
167-
00:00:02.5696949 Mixed Read/Write (In Parallel)
168-
00:00:00.7169192 Empty Pool (.TryTake())
169-
00:00:06.2741796 TOTAL
130+
00:00:00.4419158 Take From Empty (In Parallel)
131+
00:00:02.4529980 Give To (In Parallel)
132+
00:00:02.3464286 Mixed Read/Write (In Parallel)
133+
00:00:00.6892199 Empty Pool (.TryTake())
134+
00:00:05.9305623 TOTAL
170135

171136
ConcurrentQueueObjectPool...............................
172-
00:00:00.4447846 Take From Empty (In Parallel)
173-
00:00:00.6793450 Give To (In Parallel)
174-
00:00:00.5848884 Mixed Read/Write (In Parallel)
175-
00:00:00.9255401 Empty Pool (.TryTake())
176-
00:00:02.6345581 TOTAL
137+
00:00:00.4453723 Take From Empty (In Parallel)
138+
00:00:00.6651569 Give To (In Parallel)
139+
00:00:00.5769710 Mixed Read/Write (In Parallel)
140+
00:00:00.8922154 Empty Pool (.TryTake())
141+
00:00:02.5797156 TOTAL
177142

178143
OptimisticArrayObjectPool...............................
179-
00:00:13.5246195 Take From Empty (In Parallel)
180-
00:00:00.2524943 Give To (In Parallel)
181-
00:00:01.1490467 Mixed Read/Write (In Parallel)
182-
00:00:00.0721550 Empty Pool (.TryTake())
183-
00:00:14.9983155 TOTAL
184-
185-
ChannelObjectPool.......................................
186-
00:00:03.0021715 Take From Empty (In Parallel)
187-
00:00:03.3152862 Give To (In Parallel)
188-
00:00:01.8869001 Mixed Read/Write (In Parallel)
189-
00:00:00.5896046 Empty Pool (.TryTake())
190-
00:00:08.7939624 TOTAL
144+
00:00:13.4891871 Take From Empty (In Parallel)
145+
00:00:00.2492917 Give To (In Parallel)
146+
00:00:01.1461595 Mixed Read/Write (In Parallel)
147+
00:00:00.0718376 Empty Pool (.TryTake())
148+
00:00:14.9564759 TOTAL
191149

192150

benchmarking/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ static void Main(string[] args)
3131
count => () => ConcurrentQueueObjectPool.Create<object>((int)count * 2));
3232
report.AddBenchmark("OptimisticArrayObjectPool",
3333
count => () => OptimisticArrayObjectPool.Create<object>((int)count * 2));
34-
report.AddBenchmark("ChannelObjectPool",
35-
count => () => ChannelObjectPool.Create<object>((int)count * 2));
3634
report.Pretest(200, 200); // Run once through first to scramble/warm-up initial conditions.
3735

3836
Console.SetCursorPosition(0, Console.CursorTop);

0 commit comments

Comments
 (0)