Skip to content

Commit 521f1df

Browse files
author
Oren Ferrari
committed
Updates and reformatting.
Includes unused prerelease classes using Channels.
1 parent bed8275 commit 521f1df

24 files changed

Lines changed: 728 additions & 457 deletions

benchmarking/BenchmarkResult.csv

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
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.6037240,00:00:00.5527088,00:00:00.5315828,00:00:00.0900567,00:00:01.7780723,
3-
Repeat 200000 for size 4,ConcurrentQueueObjectPool,00:00:00.6749691,00:00:00.6146747,00:00:00.6101963,00:00:00.0730119,00:00:01.9728520,
4-
Repeat 200000 for size 4,ConcurrentStackObjectPool,00:00:00.6205358,00:00:00.6441162,00:00:00.5418539,00:00:00.0758358,00:00:01.8823417,
5-
Repeat 200000 for size 4,OptimisticArrayObjectPool,00:00:00.6262788,00:00:00.5193854,00:00:00.5256468,00:00:00.0980145,00:00:01.7693255,
6-
Repeat 80000 for size 10,QueueObjectPool,00:00:00.4154226,00:00:00.3984580,00:00:00.3555039,00:00:00.1029956,00:00:01.2723801,
7-
Repeat 80000 for size 10,ConcurrentQueueObjectPool,00:00:00.4010665,00:00:00.3802531,00:00:00.3610812,00:00:00.0846055,00:00:01.2270063,
8-
Repeat 80000 for size 10,ConcurrentStackObjectPool,00:00:00.4181783,00:00:00.4003157,00:00:00.3933568,00:00:00.0930685,00:00:01.3049193,
9-
Repeat 80000 for size 10,OptimisticArrayObjectPool,00:00:00.4154931,00:00:00.3539234,00:00:00.3306813,00:00:00.1595689,00:00:01.2596667,
10-
Repeat 24000 for size 50,QueueObjectPool,00:00:00.1983285,00:00:00.5393018,00:00:00.2520056,00:00:00.1437719,00:00:01.1334078,
11-
Repeat 24000 for size 50,ConcurrentQueueObjectPool,00:00:00.1911597,00:00:00.6099586,00:00:00.2019195,00:00:00.1173744,00:00:01.1204122,
12-
Repeat 24000 for size 50,ConcurrentStackObjectPool,00:00:00.1947059,00:00:00.2563897,00:00:00.2213445,00:00:00.1613517,00:00:00.8337918,
13-
Repeat 24000 for size 50,OptimisticArrayObjectPool,00:00:00.2011463,00:00:00.2458962,00:00:00.1567710,00:00:00.5725949,00:00:01.1764084,
14-
Repeat 16000 for size 100,QueueObjectPool,00:00:00.1917082,00:00:00.7281393,00:00:00.4965600,00:00:00.1853762,00:00:01.6017837,
15-
Repeat 16000 for size 100,ConcurrentQueueObjectPool,00:00:00.1913408,00:00:00.5323921,00:00:06.1167135,00:00:00.3403016,00:00:07.1807480,
16-
Repeat 16000 for size 100,ConcurrentStackObjectPool,00:00:00.1864700,00:00:00.2674701,00:00:00.2333379,00:00:00.2567077,00:00:00.9439857,
17-
Repeat 16000 for size 100,OptimisticArrayObjectPool,00:00:00.2117531,00:00:00.3088107,00:00:00.1494503,00:00:01.2309936,00:00:01.9010077,
18-
Repeat 25600 for size 250,QueueObjectPool,00:00:00.4827432,00:00:02.6029248,00:00:02.6176686,00:00:00.6578479,00:00:06.3611845,
19-
Repeat 25600 for size 250,ConcurrentQueueObjectPool,00:00:00.7486876,00:00:35.1458453,00:00:59.9447445,00:00:05.0064751,00:01:40.8457525,
20-
Repeat 25600 for size 250,ConcurrentStackObjectPool,00:00:00.5360153,00:00:01.0427376,00:00:00.9601208,00:00:01.4689654,00:00:04.0078391,
21-
Repeat 25600 for size 250,OptimisticArrayObjectPool,00:00:00.9522035,00:00:02.1958969,00:00:00.4701271,00:00:10.4725119,00:00:14.0907394,
22-
Repeat 14400 for size 500,QueueObjectPool,00:00:00.7797824,00:00:01.6503887,00:00:01.3768657,00:00:00.8861150,00:00:04.6931518,
23-
Repeat 14400 for size 500,ConcurrentQueueObjectPool,00:00:00.7994849,00:00:00.9658497,00:00:00.7778244,00:00:01.1149906,00:00:03.6581496,
24-
Repeat 14400 for size 500,ConcurrentStackObjectPool,00:00:00.7487525,00:00:02.3665267,00:00:02.6608263,00:00:03.0226290,00:00:08.7987345,
25-
Repeat 14400 for size 500,OptimisticArrayObjectPool,00:00:01.0892049,00:00:05.8599218,00:00:00.5797098,00:00:22.9215261,00:00:30.4503626,
26-
250,QueueObjectPool,00:00:00.7629885,00:00:01.7291545,00:00:01.2741500,00:00:00.8586163,00:00:04.6249093,
27-
Repeat 25600 for size 250,StackObjectPool,00:00:00.7604847,00:00:01.8116364,00:00:01.2369652,00:00:00.8626937,00:00:04.6717800,
2+
Repeat 400000 for size 4,QueueObjectPool,00:00:01.6921162,00:00:01.3999970,00:00:01.4232035,00:00:00.2110440,00:00:04.7263607,
3+
Repeat 400000 for size 4,ChannelObjectPool,00:00:01.7026834,00:00:01.6286904,00:00:01.3645671,00:00:00.2338478,00:00:04.9297887,
4+
Repeat 400000 for size 4,ConcurrentQueueObjectPool,00:00:01.7693712,00:00:01.4210947,00:00:01.3829205,00:00:00.1955725,00:00:04.7689589,
5+
Repeat 400000 for size 4,ConcurrentStackObjectPool,00:00:01.6875804,00:00:01.5369081,00:00:01.3944637,00:00:00.1756264,00:00:04.7945786,
6+
Repeat 400000 for size 4,OptimisticArrayObjectPool,00:00:01.7120099,00:00:01.3737743,00:00:01.3623827,00:00:00.2493802,00:00:04.6975471,
7+
Repeat 160000 for size 10,QueueObjectPool,00:00:01.0495375,00:00:01.0112045,00:00:00.8871979,00:00:00.2492687,00:00:03.1972086,
8+
Repeat 160000 for size 10,ChannelObjectPool,00:00:01.2164743,00:00:01.1531997,00:00:00.8866070,00:00:00.2740465,00:00:03.5303275,
9+
Repeat 160000 for size 10,ConcurrentQueueObjectPool,00:00:01.1038901,00:00:00.9417471,00:00:00.9094443,00:00:00.2277741,00:00:03.1828556,
10+
Repeat 160000 for size 10,ConcurrentStackObjectPool,00:00:01.0859551,00:00:00.9596546,00:00:00.9246417,00:00:00.2256799,00:00:03.1959313,
11+
Repeat 160000 for size 10,OptimisticArrayObjectPool,00:00:01.0775123,00:00:00.9302528,00:00:00.9021115,00:00:00.4166513,00:00:03.3265279,
12+
Repeat 48000 for size 50,QueueObjectPool,00:00:00.5258334,00:00:01.2713375,00:00:00.6293988,00:00:00.3438183,00:00:02.7703880,
13+
Repeat 48000 for size 50,ChannelObjectPool,00:00:02.4067783,00:00:01.5298450,00:00:00.6832894,00:00:00.3926395,00:00:05.0125522,
14+
Repeat 48000 for size 50,ConcurrentQueueObjectPool,00:00:00.5612132,00:00:01.4985338,00:00:00.4656040,00:00:00.3110057,00:00:02.8363567,
15+
Repeat 48000 for size 50,ConcurrentStackObjectPool,00:00:00.4972028,00:00:00.5200011,00:00:00.4378888,00:00:00.2969994,00:00:01.7520921,
16+
Repeat 48000 for size 50,OptimisticArrayObjectPool,00:00:00.5691812,00:00:00.7489502,00:00:00.4934400,00:00:01.5497079,00:00:03.3612793,
17+
Repeat 32000 for size 100,QueueObjectPool,00:00:00.5122336,00:00:02.0243072,00:00:00.8949053,00:00:00.4559207,00:00:03.8873668,
18+
Repeat 32000 for size 100,ChannelObjectPool,00:00:04.0415940,00:00:03.4503339,00:00:00.9470840,00:00:00.5190160,00:00:08.9580279,
19+
Repeat 32000 for size 100,ConcurrentQueueObjectPool,00:00:00.4979936,00:00:01.1025353,00:00:00.4270060,00:00:00.4100476,00:00:02.4375825,
20+
Repeat 32000 for size 100,ConcurrentStackObjectPool,00:00:00.4766648,00:00:00.5666903,00:00:00.5310815,00:00:00.3866519,00:00:01.9610885,
21+
Repeat 32000 for size 100,OptimisticArrayObjectPool,00:00:00.6956861,00:00:01.0975470,00:00:00.4499636,00:00:03.7336458,00:00:05.9768425,
22+
Repeat 51200 for size 250,QueueObjectPool,00:00:01.6247132,00:00:05.7028204,00:00:06.3495433,00:00:01.7208433,00:00:15.3979202,
23+
Repeat 51200 for size 250,ChannelObjectPool,00:00:09.1002442,00:00:09.5148632,00:00:07.0393499,00:00:01.9543981,00:00:27.6088554,
24+
Repeat 51200 for size 250,ConcurrentQueueObjectPool,00:00:01.3937964,00:00:03.7235199,00:00:01.2171737,00:00:01.5041405,00:00:07.8386305,
25+
Repeat 51200 for size 250,ConcurrentStackObjectPool,00:00:01.4858700,00:00:01.8964279,00:00:02.2896336,00:00:01.4461137,00:00:07.1180452,
26+
Repeat 51200 for size 250,OptimisticArrayObjectPool,00:00:02.9579032,00:00:07.0305663,00:00:01.2993861,00:00:27.8503246,00:00:39.1381802,
27+
at 25600 for size 250,StackObjectPool,00:00:00.7604847,00:00:01.8116364,00:00:01.2369652,00:00:00.8626937,00:00:04.6717800,
2828
Repeat 25600 for size 250,ConcurrentQueueObjectPool,00:00:00.8566894,00:00:00.9466838,00:00:00.7795225,00:00:01.1284017,00:00:03.7112974,
2929
Repeat 25600 for size 250,ConcurrentStackObjectPool,00:00:00.7723668,00:00:01.5778130,00:00:01.6054224,00:00:01.7977731,00:00:05.7533753,
3030
Repeat 25600 for size 250,OptimisticArrayObjectPool,00:00:01.2503504,00:00:03.2370044,00:00:00.5303349,00:00:11.9466373,00:00:16.9643270,

benchmarking/BenchmarkResult.txt

Lines changed: 140 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,160 +1,195 @@
1-
Repeat 200000 for size 4
1+
Repeat 400000 for size 4
22
------------------------------------
33

44
QueueObjectPool.........................................
5-
00:00:00.6037240 Take From Empty (In Parallel)
6-
00:00:00.5527088 Give To (In Parallel)
7-
00:00:00.5315828 Mixed Read/Write (In Parallel)
8-
00:00:00.0900567 Empty Pool (.TryTake())
9-
00:00:01.7780723 TOTAL
5+
00:00:01.6921162 Take From Empty (In Parallel)
6+
00:00:01.3999970 Give To (In Parallel)
7+
00:00:01.4232035 Mixed Read/Write (In Parallel)
8+
00:00:00.2110440 Empty Pool (.TryTake())
9+
00:00:04.7263607 TOTAL
10+
11+
ChannelObjectPool.......................................
12+
00:00:01.7026834 Take From Empty (In Parallel)
13+
00:00:01.6286904 Give To (In Parallel)
14+
00:00:01.3645671 Mixed Read/Write (In Parallel)
15+
00:00:00.2338478 Empty Pool (.TryTake())
16+
00:00:04.9297887 TOTAL
1017

1118
ConcurrentQueueObjectPool...............................
12-
00:00:00.6749691 Take From Empty (In Parallel)
13-
00:00:00.6146747 Give To (In Parallel)
14-
00:00:00.6101963 Mixed Read/Write (In Parallel)
15-
00:00:00.0730119 Empty Pool (.TryTake())
16-
00:00:01.9728520 TOTAL
19+
00:00:01.7693712 Take From Empty (In Parallel)
20+
00:00:01.4210947 Give To (In Parallel)
21+
00:00:01.3829205 Mixed Read/Write (In Parallel)
22+
00:00:00.1955725 Empty Pool (.TryTake())
23+
00:00:04.7689589 TOTAL
1724

1825
ConcurrentStackObjectPool...............................
19-
00:00:00.6205358 Take From Empty (In Parallel)
20-
00:00:00.6441162 Give To (In Parallel)
21-
00:00:00.5418539 Mixed Read/Write (In Parallel)
22-
00:00:00.0758358 Empty Pool (.TryTake())
23-
00:00:01.8823417 TOTAL
26+
00:00:01.6875804 Take From Empty (In Parallel)
27+
00:00:01.5369081 Give To (In Parallel)
28+
00:00:01.3944637 Mixed Read/Write (In Parallel)
29+
00:00:00.1756264 Empty Pool (.TryTake())
30+
00:00:04.7945786 TOTAL
2431

2532
OptimisticArrayObjectPool...............................
26-
00:00:00.6262788 Take From Empty (In Parallel)
27-
00:00:00.5193854 Give To (In Parallel)
28-
00:00:00.5256468 Mixed Read/Write (In Parallel)
29-
00:00:00.0980145 Empty Pool (.TryTake())
30-
00:00:01.7693255 TOTAL
33+
00:00:01.7120099 Take From Empty (In Parallel)
34+
00:00:01.3737743 Give To (In Parallel)
35+
00:00:01.3623827 Mixed Read/Write (In Parallel)
36+
00:00:00.2493802 Empty Pool (.TryTake())
37+
00:00:04.6975471 TOTAL
3138

3239

33-
Repeat 80000 for size 10
40+
Repeat 160000 for size 10
3441
------------------------------------
3542

3643
QueueObjectPool.........................................
37-
00:00:00.4154226 Take From Empty (In Parallel)
38-
00:00:00.3984580 Give To (In Parallel)
39-
00:00:00.3555039 Mixed Read/Write (In Parallel)
40-
00:00:00.1029956 Empty Pool (.TryTake())
41-
00:00:01.2723801 TOTAL
44+
00:00:01.0495375 Take From Empty (In Parallel)
45+
00:00:01.0112045 Give To (In Parallel)
46+
00:00:00.8871979 Mixed Read/Write (In Parallel)
47+
00:00:00.2492687 Empty Pool (.TryTake())
48+
00:00:03.1972086 TOTAL
49+
50+
ChannelObjectPool.......................................
51+
00:00:01.2164743 Take From Empty (In Parallel)
52+
00:00:01.1531997 Give To (In Parallel)
53+
00:00:00.8866070 Mixed Read/Write (In Parallel)
54+
00:00:00.2740465 Empty Pool (.TryTake())
55+
00:00:03.5303275 TOTAL
4256

4357
ConcurrentQueueObjectPool...............................
44-
00:00:00.4010665 Take From Empty (In Parallel)
45-
00:00:00.3802531 Give To (In Parallel)
46-
00:00:00.3610812 Mixed Read/Write (In Parallel)
47-
00:00:00.0846055 Empty Pool (.TryTake())
48-
00:00:01.2270063 TOTAL
58+
00:00:01.1038901 Take From Empty (In Parallel)
59+
00:00:00.9417471 Give To (In Parallel)
60+
00:00:00.9094443 Mixed Read/Write (In Parallel)
61+
00:00:00.2277741 Empty Pool (.TryTake())
62+
00:00:03.1828556 TOTAL
4963

5064
ConcurrentStackObjectPool...............................
51-
00:00:00.4181783 Take From Empty (In Parallel)
52-
00:00:00.4003157 Give To (In Parallel)
53-
00:00:00.3933568 Mixed Read/Write (In Parallel)
54-
00:00:00.0930685 Empty Pool (.TryTake())
55-
00:00:01.3049193 TOTAL
65+
00:00:01.0859551 Take From Empty (In Parallel)
66+
00:00:00.9596546 Give To (In Parallel)
67+
00:00:00.9246417 Mixed Read/Write (In Parallel)
68+
00:00:00.2256799 Empty Pool (.TryTake())
69+
00:00:03.1959313 TOTAL
5670

5771
OptimisticArrayObjectPool...............................
58-
00:00:00.4154931 Take From Empty (In Parallel)
59-
00:00:00.3539234 Give To (In Parallel)
60-
00:00:00.3306813 Mixed Read/Write (In Parallel)
61-
00:00:00.1595689 Empty Pool (.TryTake())
62-
00:00:01.2596667 TOTAL
72+
00:00:01.0775123 Take From Empty (In Parallel)
73+
00:00:00.9302528 Give To (In Parallel)
74+
00:00:00.9021115 Mixed Read/Write (In Parallel)
75+
00:00:00.4166513 Empty Pool (.TryTake())
76+
00:00:03.3265279 TOTAL
6377

6478

65-
Repeat 24000 for size 50
79+
Repeat 48000 for size 50
6680
------------------------------------
6781

6882
QueueObjectPool.........................................
69-
00:00:00.1983285 Take From Empty (In Parallel)
70-
00:00:00.5393018 Give To (In Parallel)
71-
00:00:00.2520056 Mixed Read/Write (In Parallel)
72-
00:00:00.1437719 Empty Pool (.TryTake())
73-
00:00:01.1334078 TOTAL
83+
00:00:00.5258334 Take From Empty (In Parallel)
84+
00:00:01.2713375 Give To (In Parallel)
85+
00:00:00.6293988 Mixed Read/Write (In Parallel)
86+
00:00:00.3438183 Empty Pool (.TryTake())
87+
00:00:02.7703880 TOTAL
88+
89+
ChannelObjectPool.......................................
90+
00:00:02.4067783 Take From Empty (In Parallel)
91+
00:00:01.5298450 Give To (In Parallel)
92+
00:00:00.6832894 Mixed Read/Write (In Parallel)
93+
00:00:00.3926395 Empty Pool (.TryTake())
94+
00:00:05.0125522 TOTAL
7495

7596
ConcurrentQueueObjectPool...............................
76-
00:00:00.1911597 Take From Empty (In Parallel)
77-
00:00:00.6099586 Give To (In Parallel)
78-
00:00:00.2019195 Mixed Read/Write (In Parallel)
79-
00:00:00.1173744 Empty Pool (.TryTake())
80-
00:00:01.1204122 TOTAL
97+
00:00:00.5612132 Take From Empty (In Parallel)
98+
00:00:01.4985338 Give To (In Parallel)
99+
00:00:00.4656040 Mixed Read/Write (In Parallel)
100+
00:00:00.3110057 Empty Pool (.TryTake())
101+
00:00:02.8363567 TOTAL
81102

82103
ConcurrentStackObjectPool...............................
83-
00:00:00.1947059 Take From Empty (In Parallel)
84-
00:00:00.2563897 Give To (In Parallel)
85-
00:00:00.2213445 Mixed Read/Write (In Parallel)
86-
00:00:00.1613517 Empty Pool (.TryTake())
87-
00:00:00.8337918 TOTAL
104+
00:00:00.4972028 Take From Empty (In Parallel)
105+
00:00:00.5200011 Give To (In Parallel)
106+
00:00:00.4378888 Mixed Read/Write (In Parallel)
107+
00:00:00.2969994 Empty Pool (.TryTake())
108+
00:00:01.7520921 TOTAL
88109

89110
OptimisticArrayObjectPool...............................
90-
00:00:00.2011463 Take From Empty (In Parallel)
91-
00:00:00.2458962 Give To (In Parallel)
92-
00:00:00.1567710 Mixed Read/Write (In Parallel)
93-
00:00:00.5725949 Empty Pool (.TryTake())
94-
00:00:01.1764084 TOTAL
111+
00:00:00.5691812 Take From Empty (In Parallel)
112+
00:00:00.7489502 Give To (In Parallel)
113+
00:00:00.4934400 Mixed Read/Write (In Parallel)
114+
00:00:01.5497079 Empty Pool (.TryTake())
115+
00:00:03.3612793 TOTAL
95116

96117

97-
Repeat 16000 for size 100
118+
Repeat 32000 for size 100
98119
------------------------------------
99120

100121
QueueObjectPool.........................................
101-
00:00:00.1917082 Take From Empty (In Parallel)
102-
00:00:00.7281393 Give To (In Parallel)
103-
00:00:00.4965600 Mixed Read/Write (In Parallel)
104-
00:00:00.1853762 Empty Pool (.TryTake())
105-
00:00:01.6017837 TOTAL
122+
00:00:00.5122336 Take From Empty (In Parallel)
123+
00:00:02.0243072 Give To (In Parallel)
124+
00:00:00.8949053 Mixed Read/Write (In Parallel)
125+
00:00:00.4559207 Empty Pool (.TryTake())
126+
00:00:03.8873668 TOTAL
127+
128+
ChannelObjectPool.......................................
129+
00:00:04.0415940 Take From Empty (In Parallel)
130+
00:00:03.4503339 Give To (In Parallel)
131+
00:00:00.9470840 Mixed Read/Write (In Parallel)
132+
00:00:00.5190160 Empty Pool (.TryTake())
133+
00:00:08.9580279 TOTAL
106134

107135
ConcurrentQueueObjectPool...............................
108-
00:00:00.1913408 Take From Empty (In Parallel)
109-
00:00:00.5323921 Give To (In Parallel)
110-
00:00:06.1167135 Mixed Read/Write (In Parallel)
111-
00:00:00.3403016 Empty Pool (.TryTake())
112-
00:00:07.1807480 TOTAL
136+
00:00:00.4979936 Take From Empty (In Parallel)
137+
00:00:01.1025353 Give To (In Parallel)
138+
00:00:00.4270060 Mixed Read/Write (In Parallel)
139+
00:00:00.4100476 Empty Pool (.TryTake())
140+
00:00:02.4375825 TOTAL
113141

114142
ConcurrentStackObjectPool...............................
115-
00:00:00.1864700 Take From Empty (In Parallel)
116-
00:00:00.2674701 Give To (In Parallel)
117-
00:00:00.2333379 Mixed Read/Write (In Parallel)
118-
00:00:00.2567077 Empty Pool (.TryTake())
119-
00:00:00.9439857 TOTAL
143+
00:00:00.4766648 Take From Empty (In Parallel)
144+
00:00:00.5666903 Give To (In Parallel)
145+
00:00:00.5310815 Mixed Read/Write (In Parallel)
146+
00:00:00.3866519 Empty Pool (.TryTake())
147+
00:00:01.9610885 TOTAL
120148

121149
OptimisticArrayObjectPool...............................
122-
00:00:00.2117531 Take From Empty (In Parallel)
123-
00:00:00.3088107 Give To (In Parallel)
124-
00:00:00.1494503 Mixed Read/Write (In Parallel)
125-
00:00:01.2309936 Empty Pool (.TryTake())
126-
00:00:01.9010077 TOTAL
150+
00:00:00.6956861 Take From Empty (In Parallel)
151+
00:00:01.0975470 Give To (In Parallel)
152+
00:00:00.4499636 Mixed Read/Write (In Parallel)
153+
00:00:03.7336458 Empty Pool (.TryTake())
154+
00:00:05.9768425 TOTAL
127155

128156

129-
Repeat 25600 for size 250
157+
Repeat 51200 for size 250
130158
------------------------------------
131159

132160
QueueObjectPool.........................................
133-
00:00:00.4827432 Take From Empty (In Parallel)
134-
00:00:02.6029248 Give To (In Parallel)
135-
00:00:02.6176686 Mixed Read/Write (In Parallel)
136-
00:00:00.6578479 Empty Pool (.TryTake())
137-
00:00:06.3611845 TOTAL
161+
00:00:01.6247132 Take From Empty (In Parallel)
162+
00:00:05.7028204 Give To (In Parallel)
163+
00:00:06.3495433 Mixed Read/Write (In Parallel)
164+
00:00:01.7208433 Empty Pool (.TryTake())
165+
00:00:15.3979202 TOTAL
166+
167+
ChannelObjectPool.......................................
168+
00:00:09.1002442 Take From Empty (In Parallel)
169+
00:00:09.5148632 Give To (In Parallel)
170+
00:00:07.0393499 Mixed Read/Write (In Parallel)
171+
00:00:01.9543981 Empty Pool (.TryTake())
172+
00:00:27.6088554 TOTAL
138173

139174
ConcurrentQueueObjectPool...............................
140-
00:00:00.7486876 Take From Empty (In Parallel)
141-
00:00:35.1458453 Give To (In Parallel)
142-
00:00:59.9447445 Mixed Read/Write (In Parallel)
143-
00:00:05.0064751 Empty Pool (.TryTake())
144-
00:01:40.8457525 TOTAL
175+
00:00:01.3937964 Take From Empty (In Parallel)
176+
00:00:03.7235199 Give To (In Parallel)
177+
00:00:01.2171737 Mixed Read/Write (In Parallel)
178+
00:00:01.5041405 Empty Pool (.TryTake())
179+
00:00:07.8386305 TOTAL
145180

146181
ConcurrentStackObjectPool...............................
147-
00:00:00.5360153 Take From Empty (In Parallel)
148-
00:00:01.0427376 Give To (In Parallel)
149-
00:00:00.9601208 Mixed Read/Write (In Parallel)
150-
00:00:01.4689654 Empty Pool (.TryTake())
151-
00:00:04.0078391 TOTAL
182+
00:00:01.4858700 Take From Empty (In Parallel)
183+
00:00:01.8964279 Give To (In Parallel)
184+
00:00:02.2896336 Mixed Read/Write (In Parallel)
185+
00:00:01.4461137 Empty Pool (.TryTake())
186+
00:00:07.1180452 TOTAL
152187

153188
OptimisticArrayObjectPool...............................
154-
00:00:00.9522035 Take From Empty (In Parallel)
155-
00:00:02.1958969 Give To (In Parallel)
156-
00:00:00.4701271 Mixed Read/Write (In Parallel)
157-
00:00:10.4725119 Empty Pool (.TryTake())
158-
00:00:14.0907394 TOTAL
189+
00:00:02.9579032 Take From Empty (In Parallel)
190+
00:00:07.0305663 Give To (In Parallel)
191+
00:00:01.2993861 Mixed Read/Write (In Parallel)
192+
00:00:27.8503246 Empty Pool (.TryTake())
193+
00:00:39.1381802 TOTAL
159194

160195

benchmarking/Program.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ static void Main(string[] args)
2626
report.AddBenchmark("QueueObjectPool", // Note, that this one isn't far off from the following in peformance.
2727
count => () => QueueObjectPool.Create<object>((int)count * 2));
2828

29+
//report.AddBenchmark("ChannelObjectPool",
30+
// count => () => ChannelObjectPool.Create<object>((int)count * 2));
31+
2932
report.AddBenchmark("ConcurrentQueueObjectPool", // Note, that this one isn't far off from the following in peformance, but definitely is faster than LinkedListObjectPool and the rest.
3033
count => () => ConcurrentQueueObjectPool.Create<object>((int)count * 2));
3134

@@ -43,11 +46,12 @@ static void Main(string[] args)
4346

4447
Console.SetCursorPosition(0, Console.CursorTop);
4548

46-
report.Test(4, 8);
47-
report.Test(10, 8);
48-
report.Test(50, 12);
49-
report.Test(100, 16);
50-
report.Test(250, 64);
49+
const int loopMultiple = 2;
50+
report.Test(4, 8 * loopMultiple);
51+
report.Test(10, 8 * loopMultiple);
52+
report.Test(50, 12 * loopMultiple);
53+
report.Test(100, 16 * loopMultiple);
54+
report.Test(250, 64 * loopMultiple);
5155
//report.Test(500, 72);
5256

5357
File.WriteAllText("./BenchmarkResult.txt", sb.ToString());

0 commit comments

Comments
 (0)