<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Queue on Mia Heidenstedt</title><link>https://heidenstedt.org/tags/queue/</link><description>Recent
content
in Queue on Mia Heidenstedt</description><generator>
Hugo</generator><language>en</language><lastBuildDate>Sun, 06 Jul 2025 15:49:51 +0000</lastBuildDate><atom:link href="https://heidenstedt.org/tags/queue/index.xml" rel="self" type="application/rss+xml"/><item><title>Releasing: GoQueueBench</title><link>https://heidenstedt.org/posts/2025/releasing-goqueuebench/</link><pubDate>Tue, 25 Mar 2025 15:44:38 +0000</pubDate><guid>https://heidenstedt.org/posts/2025/releasing-goqueuebench/</guid><description><![CDATA[<p>
      <em>Best viewed on the <a href="https://heidenstedt.org/posts/2025/releasing-goqueuebench/">original page</a>, where extended functionality like the
    footnote helper is available.</em>
    </p><p>As i coded on <a href="https://github.com/i5heu/ouroboros-db">OuroborosDB</a> i noticed that i need a very fast queue for a rather unique architectural design decision.<br>
I try to build the network module in such a way that i can test the behavior completely deterministic while &ldquo;simulating&rdquo; entire clusters in a single process.</p>
<p>So i build a test prototype of my global network queue with go&rsquo;s channels and noticed that it was a major performance bottleneck, after writing 2 different ring buffer queue implementations it became clear that some queues behave completely different under different congestion levels and core counts - some so unpredictable that i just did not wanted to use them in my project.</p>
<p>This prompted me to take a relatively large chunk out of my free time and write a suite to benchmark different queue implementations i build under different conditions and score them based on their performance and predictability.</p>
<p>The result of this work is <a href="https://github.com/i5heu/GoQueueBench">GoQueueBench</a></p>
<p>These are the results of the benchmark suite:</p>
<table>
	<thead>
			<tr>
					<th>Implementation</th>
					<th>Overall Score</th>
					<th>Throughput Light Load</th>
					<th>Throughput Heavy Load</th>
					<th>Throughput Average</th>
					<th>Stability Ratio</th>
					<th>Homogeneity Factor</th>
					<th>Uncertainty</th>
					<th>Total Tests</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>VortexQueue</td>
					<td><strong>11341466</strong></td>
					<td>6926449</td>
					<td><strong>5502925</strong></td>
					<td><strong>8776309</strong></td>
					<td><strong>1.15</strong></td>
					<td>0.87</td>
					<td><strong>0.25</strong></td>
					<td>681</td>
			</tr>
			<tr>
					<td>LightningQueue</td>
					<td>9631771</td>
					<td>6638213</td>
					<td>4627690</td>
					<td>6036728</td>
					<td>0.99</td>
					<td><strong>0.95</strong></td>
					<td>0.31</td>
					<td>681</td>
			</tr>
			<tr>
					<td>FastMPMCQueue</td>
					<td>9384067</td>
					<td>6870924</td>
					<td>4598620</td>
					<td>6070151</td>
					<td>0.96</td>
					<td>0.93</td>
					<td>0.28</td>
					<td>681</td>
			</tr>
			<tr>
					<td>OptimizedMPMCQueue</td>
					<td>9105262</td>
					<td>6436385</td>
					<td>4379823</td>
					<td>5838555</td>
					<td>0.97</td>
					<td>0.94</td>
					<td>0.32</td>
					<td>681</td>
			</tr>
			<tr>
					<td>OptimizedMPMCQueueSharded</td>
					<td>8130197</td>
					<td>6369891</td>
					<td>3834140</td>
					<td>6781865</td>
					<td>0.84</td>
					<td>0.88</td>
					<td>0.39</td>
					<td>681</td>
			</tr>
			<tr>
					<td>MultiHeadQueue</td>
					<td>7391203</td>
					<td>4363332</td>
					<td>3492068</td>
					<td>5558849</td>
					<td>1.12</td>
					<td>0.91</td>
					<td>0.36</td>
					<td>681</td>
			</tr>
			<tr>
					<td>BasicMPMCQueue</td>
					<td>5599252</td>
					<td>4370889</td>
					<td>2669612</td>
					<td>3667715</td>
					<td>0.89</td>
					<td>0.93</td>
					<td>0.30</td>
					<td>681</td>
			</tr>
			<tr>
					<td>Golang Buffered Channel</td>
					<td>5312485</td>
					<td>6667828</td>
					<td>2760985</td>
					<td>4312720</td>
					<td>0.54</td>
					<td>0.82</td>
					<td>0.66</td>
					<td>681</td>
			</tr>
			<tr>
					<td>FastMPMCQueueTicket</td>
					<td>3229780</td>
					<td><strong>7705164</strong></td>
					<td>1203924</td>
					<td>5803821</td>
					<td>0.21</td>
					<td>0.64</td>
					<td>1.19</td>
					<td>681</td>
			</tr>
	</tbody>
</table>
<p>Please note that i build the package so that all queue adhere to the same interface and can be swapped out easily.</p>
]]></description><content:encoded><![CDATA[<p>
      <em>Best viewed on the <a href="https://heidenstedt.org/posts/2025/releasing-goqueuebench/">original page</a>, where extended functionality like the
    footnote helper is available.</em>
    </p><p>As i coded on <a href="https://github.com/i5heu/ouroboros-db">OuroborosDB</a> i noticed that i need a very fast queue for a rather unique architectural design decision.<br>
I try to build the network module in such a way that i can test the behavior completely deterministic while &ldquo;simulating&rdquo; entire clusters in a single process.</p>
<p>So i build a test prototype of my global network queue with go&rsquo;s channels and noticed that it was a major performance bottleneck, after writing 2 different ring buffer queue implementations it became clear that some queues behave completely different under different congestion levels and core counts - some so unpredictable that i just did not wanted to use them in my project.</p>
<p>This prompted me to take a relatively large chunk out of my free time and write a suite to benchmark different queue implementations i build under different conditions and score them based on their performance and predictability.</p>
<p>The result of this work is <a href="https://github.com/i5heu/GoQueueBench">GoQueueBench</a></p>
<p>These are the results of the benchmark suite:</p>
<table>
	<thead>
			<tr>
					<th>Implementation</th>
					<th>Overall Score</th>
					<th>Throughput Light Load</th>
					<th>Throughput Heavy Load</th>
					<th>Throughput Average</th>
					<th>Stability Ratio</th>
					<th>Homogeneity Factor</th>
					<th>Uncertainty</th>
					<th>Total Tests</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>VortexQueue</td>
					<td><strong>11341466</strong></td>
					<td>6926449</td>
					<td><strong>5502925</strong></td>
					<td><strong>8776309</strong></td>
					<td><strong>1.15</strong></td>
					<td>0.87</td>
					<td><strong>0.25</strong></td>
					<td>681</td>
			</tr>
			<tr>
					<td>LightningQueue</td>
					<td>9631771</td>
					<td>6638213</td>
					<td>4627690</td>
					<td>6036728</td>
					<td>0.99</td>
					<td><strong>0.95</strong></td>
					<td>0.31</td>
					<td>681</td>
			</tr>
			<tr>
					<td>FastMPMCQueue</td>
					<td>9384067</td>
					<td>6870924</td>
					<td>4598620</td>
					<td>6070151</td>
					<td>0.96</td>
					<td>0.93</td>
					<td>0.28</td>
					<td>681</td>
			</tr>
			<tr>
					<td>OptimizedMPMCQueue</td>
					<td>9105262</td>
					<td>6436385</td>
					<td>4379823</td>
					<td>5838555</td>
					<td>0.97</td>
					<td>0.94</td>
					<td>0.32</td>
					<td>681</td>
			</tr>
			<tr>
					<td>OptimizedMPMCQueueSharded</td>
					<td>8130197</td>
					<td>6369891</td>
					<td>3834140</td>
					<td>6781865</td>
					<td>0.84</td>
					<td>0.88</td>
					<td>0.39</td>
					<td>681</td>
			</tr>
			<tr>
					<td>MultiHeadQueue</td>
					<td>7391203</td>
					<td>4363332</td>
					<td>3492068</td>
					<td>5558849</td>
					<td>1.12</td>
					<td>0.91</td>
					<td>0.36</td>
					<td>681</td>
			</tr>
			<tr>
					<td>BasicMPMCQueue</td>
					<td>5599252</td>
					<td>4370889</td>
					<td>2669612</td>
					<td>3667715</td>
					<td>0.89</td>
					<td>0.93</td>
					<td>0.30</td>
					<td>681</td>
			</tr>
			<tr>
					<td>Golang Buffered Channel</td>
					<td>5312485</td>
					<td>6667828</td>
					<td>2760985</td>
					<td>4312720</td>
					<td>0.54</td>
					<td>0.82</td>
					<td>0.66</td>
					<td>681</td>
			</tr>
			<tr>
					<td>FastMPMCQueueTicket</td>
					<td>3229780</td>
					<td><strong>7705164</strong></td>
					<td>1203924</td>
					<td>5803821</td>
					<td>0.21</td>
					<td>0.64</td>
					<td>1.19</td>
					<td>681</td>
			</tr>
	</tbody>
</table>
<p>Please note that i build the package so that all queue adhere to the same interface and can be swapped out easily.</p>
]]></content:encoded></item></channel></rss>