<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="135748" data-post-id="135748">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="seb5law" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  seb5law
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Same here, values of size 100mb are no problem at all, it just takes a bit. I read in a file of size 107MB and put it in cubdb:</p>
<pre><code>Get from DB                    1.13      881.76 ms     ±2.06%      881.40 ms      910.80 ms
Write File to db               0.27     3757.36 ms     ±2.09%     3757.36 ms     3812.85 ms
</code></pre>
<p>Benchmarked with benchee in iex(should be faster in production code)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="135748" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/cubdb-a-pure-elixir-embedded-key-value-database/23397/32">Post #31</a>
	                </div>
	            </div>
              <div id="likers-container-135748" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="135748"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #31"></div>
  </section>
</div>
    <div class="postbit" id="135763" data-post-id="135763">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lucaong" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lucaong/120/21794_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lucaong
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Interestingly, the real bottleneck seems to be compression, not writing the file. I did not expect that, but the fix would be quite easy. I will work on a release that exposes an option to control compression setting or completely disable it.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="135763" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/cubdb-a-pure-elixir-embedded-key-value-database/23397/33">Post #32</a>
	                </div>
	            </div>
              <div id="likers-container-135763" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="135763"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #32"></div>
  </section>
</div>
    <div class="postbit" id="135767" data-post-id="135767">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lucaong" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lucaong/120/21794_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lucaong
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I released version <code>v0.9.0</code>, that is substantially more performant on large entries, like in <a class="mention" href="/u/seb5law" rel="nofollow">@seb5law</a> 's use-case.</p>
<p>Compression is now disabled, as it adds more drawbacks than benefits (large entries experience much slower writes, and small entries do not benefit much from compression anyway). This release is still completely backward compatible.</p>
<p>I will consider re-adding compression as a feature in a later release, but only after careful benchmarking, and with a way for the user to configure its parameters.</p>
<p>I will also add benchmarks with <code>Benchee</code> before version <code>1.0.0</code>, to avoid these kinds of easily detectable performance regressions.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="135767" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/cubdb-a-pure-elixir-embedded-key-value-database/23397/34">Post #33</a>
	                </div>
	            </div>
              <div id="likers-container-135767" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="135767"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #33"></div>
  </section>
</div>
    <div class="postbit" id="135810" data-post-id="135810">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lucaong" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lucaong/120/21794_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lucaong
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>And here is the benchmark for <code>v0.9.0</code> and default options on my MacBook Pro, showing a big improvement with large values (the full suite of benchmarks can now be run with <code>make benchmarks</code>):</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">##### With input 10MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3         30.93       32.34 ms     ±7.37%       31.48 ms       40.38 ms

##### With input 1MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3        262.95        3.80 ms    ±30.40%        3.77 ms        5.46 ms

##### With input 1kb value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3        6.67 K      149.86 μs   ±134.87%         141 μs         293 μs

##### With input small value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3        6.95 K      143.92 μs    ±40.53%         136 μs         296 μs
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="135810" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/cubdb-a-pure-elixir-embedded-key-value-database/23397/35">Post #34</a>
	                </div>
	            </div>
              <div id="likers-container-135810" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="135810"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #34"></div>
  </section>
</div>
    <div class="postbit" id="135814" data-post-id="135814">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="wolfiton" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/wolfiton/120/15884_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  wolfiton
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Could you compare this with redis?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="135814" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/cubdb-a-pure-elixir-embedded-key-value-database/23397/36">Post #35</a>
	                </div>
	            </div>
              <div id="likers-container-135814" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="135814"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #35"></div>
  </section>
</div>
    <div class="postbit" id="135865" data-post-id="135865">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lucaong" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lucaong/120/21794_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lucaong
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hi <a class="mention" href="/u/wolfiton" rel="nofollow">@wolfiton</a>,<br>
thanks for your question. I really admire the engineering work of the Redis author, Salvatore Sanfilippo, so it’s nice for me to see CubDB and Redis discussed in the same context.</p>
<p>That said, the Redis and CubDB have considerably different goals and characteristics, and I think the overlap in use-case is quite small. I will try to clarify that a bit:</p>
<ul>
<li>
<p>Redis is a “data structure server”, to which one connects over the network. It keeps data primarily in memory to ensure very fast operations, and uses the disk to recover after a restart. It offers several different data structures (maps, list, sorted sets, streams, etc.) and is agnostic about the programming language used by the user. So, it is shared (multiple apps/instances can connect to one Redis db), very fast, but data must fit in memory. Common use-cases for Redis are: shared in-memory cache, shared data-structure for queues or parallel computation, shared locks.</p>
</li>
<li>
<p>CubDB is an embedded database, so it run “inside” your application, with no network connection. It works sort of like a map, but persisted on disk (plus all the sorted lookup operations). It can be used directly only by Elixir or Erlang, but has the convenience of having zero dependencies and storing native Elixir terms without requiring the user to implement serialization/deserialization. It is not shared between different apps/instances (unless you implement yourself a server layer on top of it). It stores data primarily on disk, so it can store more data that can fit in memory. It’s designed for robustness in case of power failures, and simplicity to install and use from Elixir apps. Primary use cases would be data storage for an embedded application (think Nerves running on a Raspberry Pi), or data storage within one app instance.</p>
</li>
</ul>
<p>Of course, one could build a small server on top of CubDB, and expose its features over a network, achieving something comparable to Redis maps. That would be a nice project <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
<p>Right now I am working on the core, and focusing on doing one thing well: a versatile and robust key/value storage.  Hopefully that will enable developers to get creative and build more use cases on top of it.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="135865" data-batch-url="/posts/batch_likers">
                        9
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/cubdb-a-pure-elixir-embedded-key-value-database/23397/37">Post #36</a>
	                </div>
	            </div>
              <div id="likers-container-135865" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="135865"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #36"></div>
  </section>
</div>
    <div class="postbit" id="135878" data-post-id="135878">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="seb5law" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  seb5law
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I ran the same benchmarks with CubDB Version 0.9.0 with the following results:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">Operating System: Linux
CPU Information: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
Number of Available Cores: 4
Available memory: 15.11 GB
Elixir 1.9.0
Erlang 22.0.4

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 5 s
memory time: 0 ns
parallel: 1
inputs: 10MB value, 1KB value, 1MB value, small value
Estimated total run time: 28 s

Benchmarking CubDB.put/3 with input 10MB value...
280 entries written to database.
Benchmarking CubDB.put/3 with input 1KB value...
9854 entries written to database.
Benchmarking CubDB.put/3 with input 1MB value...
1403 entries written to database.
Benchmarking CubDB.put/3 with input small value...
9928 entries written to database.

##### With input 10MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3         33.92       29.48 ms   ±180.14%       16.60 ms      372.86 ms

##### With input 1KB value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3        5.82 K      171.80 μs   ±202.40%      152.79 μs      492.24 μs

##### With input 1MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3         87.72       11.40 ms   ±844.87%        2.09 ms      476.15 ms

##### With input small value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3        7.20 K      138.92 μs    ±31.21%      133.08 μs      225.80 μs
mix run benchmarks/get.exs
Operating System: Linux
CPU Information: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
Number of Available Cores: 4
Available memory: 15.11 GB
Elixir 1.9.0
Erlang 22.0.4

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 5 s
memory time: 0 ns
parallel: 1
inputs: 10MB value, 1KB value, 1MB value, small value
Estimated total run time: 28 s

Benchmarking CubDB.get/3 with input 10MB value...
Benchmarking CubDB.get/3 with input 1KB value...
Benchmarking CubDB.get/3 with input 1MB value...
Benchmarking CubDB.get/3 with input small value...

##### With input 10MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.get/3         99.74       10.03 ms    ±10.98%        9.72 ms       14.87 ms

##### With input 1KB value #####
Name                  ips        average  deviation         median         99th %
CubDB.get/3       20.19 K       49.52 μs    ±83.73%       42.70 μs      161.51 μs

##### With input 1MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.get/3        959.79        1.04 ms   ±220.99%        0.89 ms        2.47 ms

##### With input small value #####
Name                  ips        average  deviation         median         99th %
CubDB.get/3       24.46 K       40.89 μs    ±43.33%       37.50 μs       81.68 μs

</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="135878" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/cubdb-a-pure-elixir-embedded-key-value-database/23397/38">Post #37</a>
	                </div>
	            </div>
              <div id="likers-container-135878" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="135878"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #37"></div>
  </section>
</div>
    <div class="postbit" id="135887" data-post-id="135887">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="wolfiton" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/wolfiton/120/15884_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  wolfiton
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thank you <a class="mention" href="/u/lucaong" rel="nofollow">@lucaong</a> for the comparison and also for providing a very clear picture of the possibilities and  features of CubDB.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="135887" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/cubdb-a-pure-elixir-embedded-key-value-database/23397/39">Post #38</a>
	                </div>
	            </div>
              <div id="likers-container-135887" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="135887"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #38"></div>
  </section>
</div>
    <div class="postbit" id="137525" data-post-id="137525">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dch" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dch/120/2682_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dch
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I ran a few rounds on my admittedly server-class desktop for comparison, with 3 different storage systems: ramdisk (using UFS-like “disk” format, NVMe drive (zfs), and a ZRAID10 zfs striped mirror. The system is running a development OS kernel <code>FreeBSD 13.0-CURRENT r349991+b5dc7bcdcb12(master) GENERIC  amd64</code>, but nonetheless its interesting - it’s a <code>metric shitload</code> faster, and in general the deviation is lower. The box is unfortunately not idle. There is not really any CPU limitation to speak of, so we are really just looking here at impacts of IO. The most noticeable effect is that ZFS really starts to show off when compression matters - the 10KiB &amp; 1MiB range. I expect that using snappy compression will not show the massive slowdowns that are seen using (gzip) based erlang term compression BTW. <a href="https://github.com/skunkwerks/snappy-erlang-nif" class="inline-onebox" rel="noopener nofollow ugc">GitHub - skunkwerks/snappy-erlang-nif: An Erlang NIF wrapper for Google's snappy compressor/decompressor · GitHub</a> or <a href="https://github.com/mururu/zstd-erlang" class="inline-onebox" rel="noopener nofollow ugc">GitHub - mururu/zstd-erlang: Zstd binding for Erlang/Elixir · GitHub</a> are both optimised for very high throughput, and still show overall good compression.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"># ramdisk
Benchmark: put/3
================
mix run benchmarks/put.exs
Operating System: FreeBSD
CPU Information: Intel(R) Xeon(R) CPU E5-2667 v4 @ 3.20GHz
Number of Available Cores: 8
Available memory: 127.83 GB
Elixir 1.9.1
Erlang 22.0.7

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 5 s
memory time: 0 ns
parallel: 1
inputs: 10MB value, 1KB value, 1MB value, small value, small value, auto sync
Estimated total run time: 35 s

Benchmarking CubDB.put/3 with input 10MB value...
225 entries written to database.
Benchmarking CubDB.put/3 with input 1KB value...
9869 entries written to database.
Benchmarking CubDB.put/3 with input 1MB value...
1537 entries written to database.
Benchmarking CubDB.put/3 with input small value...
9911 entries written to database.
Benchmarking CubDB.put/3 with input small value, auto sync...
9871 entries written to database.

##### With input 10MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3         34.34       29.12 ms    ±16.86%       28.13 ms       65.94 ms

##### With input 1KB value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3        6.41 K      156.05 μs    ±14.92%      154.44 μs      187.16 μs

##### With input 1MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3        238.78        4.19 ms     ±3.71%        4.14 ms        4.72 ms

##### With input small value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3        6.60 K      151.47 μs    ±14.94%      150.22 μs      179.49 μs

##### With input small value, auto sync #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3        6.33 K      157.86 μs     ±9.33%      156.40 μs      188.43 μs

Benchmark: get/3
================
mix run benchmarks/get.exs
Operating System: FreeBSD
CPU Information: Intel(R) Xeon(R) CPU E5-2667 v4 @ 3.20GHz
Number of Available Cores: 8
Available memory: 127.83 GB
Elixir 1.9.1
Erlang 22.0.7

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 5 s
memory time: 0 ns
parallel: 1
inputs: 10MB value, 1KB value, 1MB value, small value
Estimated total run time: 28 s

Benchmarking CubDB.get/3 with input 10MB value...
Benchmarking CubDB.get/3 with input 1KB value...
Benchmarking CubDB.get/3 with input 1MB value...
Benchmarking CubDB.get/3 with input small value...

##### With input 10MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.get/3         98.01       10.20 ms    ±38.66%        8.79 ms       22.29 ms

##### With input 1KB value #####
Name                  ips        average  deviation         median         99th %
CubDB.get/3       18.84 K       53.08 μs    ±43.19%       50.56 μs       78.29 μs

##### With input 1MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.get/3        1.27 K      790.08 μs    ±13.73%      778.78 μs      945.01 μs

##### With input small value #####
Name                  ips        average  deviation         median         99th %
CubDB.get/3       20.38 K       49.06 μs    ±30.11%       46.45 μs       69.86 μs
</code></pre>
<pre data-code-wrap="elixir"><code class="lang-elixir"># NVMe drive
Benchmark: put/3
================
mix run benchmarks/put.exs
Operating System: FreeBSD
CPU Information: Intel(R) Xeon(R) CPU E5-2667 v4 @ 3.20GHz
Number of Available Cores: 8
Available memory: 127.83 GB
Elixir 1.9.1
Erlang 22.0.7

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 5 s
memory time: 0 ns
parallel: 1
inputs: 10MB value, 1KB value, 1MB value, small value, small value, auto sync
Estimated total run time: 35 s

Benchmarking CubDB.put/3 with input 10MB value...
42 entries written to database.
Benchmarking CubDB.put/3 with input 1KB value...
5567 entries written to database.
Benchmarking CubDB.put/3 with input 1MB value...
360 entries written to database.
Benchmarking CubDB.put/3 with input small value...
5538 entries written to database.
Benchmarking CubDB.put/3 with input small value, auto sync...
2325 entries written to database.

##### With input 10MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3          6.03      165.92 ms     ±9.25%      162.61 ms      248.04 ms

##### With input 1KB value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3        1.19 K      839.04 μs    ±22.03%      811.18 μs     1886.29 μs

##### With input 1MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3         51.69       19.35 ms    ±69.71%       18.34 ms       22.69 ms

##### With input small value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3        1.20 K      836.28 μs    ±26.43%      813.54 μs     1442.62 μs

##### With input small value, auto sync #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3        351.47        2.85 ms    ±34.43%        2.91 ms        4.62 ms

Benchmark: get/3
================
mix run benchmarks/get.exs
Operating System: FreeBSD
CPU Information: Intel(R) Xeon(R) CPU E5-2667 v4 @ 3.20GHz
Number of Available Cores: 8
Available memory: 127.83 GB
Elixir 1.9.1
Erlang 22.0.7

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 5 s
memory time: 0 ns
parallel: 1
inputs: 10MB value, 1KB value, 1MB value, small value
Estimated total run time: 28 s

Benchmarking CubDB.get/3 with input 10MB value...
Benchmarking CubDB.get/3 with input 1KB value...
Benchmarking CubDB.get/3 with input 1MB value...
Benchmarking CubDB.get/3 with input small value...

##### With input 10MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.get/3         75.29       13.28 ms    ±48.01%       10.05 ms       22.24 ms

##### With input 1KB value #####
Name                  ips        average  deviation         median         99th %
CubDB.get/3        9.40 K      106.40 μs    ±32.09%      104.16 μs      145.96 μs

##### With input 1MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.get/3        1.45 K      689.32 μs   ±190.37%      651.65 μs      974.44 μs

##### With input small value #####
Name                  ips        average  deviation         median         99th %
CubDB.get/3        9.79 K      102.17 μs    ±16.25%      100.55 μs      128.27 μs
</code></pre>
<pre data-code-wrap="elixir"><code class="lang-elixir"># ZRAID10 striped mirror

Benchmark: put/3
================
mix run benchmarks/put.exs
Operating System: FreeBSD
CPU Information: Intel(R) Xeon(R) CPU E5-2667 v4 @ 3.20GHz
Number of Available Cores: 8
Available memory: 127.83 GB
Elixir 1.9.1
Erlang 22.0.7

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 5 s
memory time: 0 ns
parallel: 1
inputs: 10MB value, 1KB value, 1MB value, small value, small value, auto sync
Estimated total run time: 35 s

Benchmarking CubDB.put/3 with input 10MB value...
45 entries written to database.
Benchmarking CubDB.put/3 with input 1KB value...
5508 entries written to database.
Benchmarking CubDB.put/3 with input 1MB value...
400 entries written to database.
Benchmarking CubDB.put/3 with input small value...
5676 entries written to database.
Benchmarking CubDB.put/3 with input small value, auto sync...
699 entries written to database.

##### With input 10MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3          6.28      159.35 ms    ±17.98%      149.13 ms      294.63 ms

##### With input 1KB value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3        1.19 K      841.11 μs    ±19.13%      808.08 μs     1878.28 μs

##### With input 1MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3         57.31       17.45 ms    ±21.02%       16.74 ms       36.38 ms

##### With input small value #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3        1.21 K      827.99 μs    ±13.90%      807.49 μs     1397.60 μs

##### With input small value, auto sync #####
Name                  ips        average  deviation         median         99th %
CubDB.put/3         96.94       10.32 ms    ±47.55%       11.30 ms       27.47 ms

Benchmark: get/3
================
mix run benchmarks/get.exs
Operating System: FreeBSD
CPU Information: Intel(R) Xeon(R) CPU E5-2667 v4 @ 3.20GHz
Number of Available Cores: 8
Available memory: 127.83 GB
Elixir 1.9.1
Erlang 22.0.7

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 5 s
memory time: 0 ns
parallel: 1
inputs: 10MB value, 1KB value, 1MB value, small value
Estimated total run time: 28 s

Benchmarking CubDB.get/3 with input 10MB value...
Benchmarking CubDB.get/3 with input 1KB value...
Benchmarking CubDB.get/3 with input 1MB value...
Benchmarking CubDB.get/3 with input small value...

##### With input 10MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.get/3        103.71        9.64 ms    ±53.65%        7.19 ms       21.91 ms

##### With input 1KB value #####
Name                  ips        average  deviation         median         99th %
CubDB.get/3        9.39 K      106.50 μs    ±39.19%      104.20 μs      141.42 μs

##### With input 1MB value #####
Name                  ips        average  deviation         median         99th %
CubDB.get/3        1.34 K      744.06 μs    ±30.24%      695.75 μs     1836.90 μs

##### With input small value #####
Name                  ips        average  deviation         median         99th %
CubDB.get/3        9.77 K      102.36 μs    ±14.72%      101.01 μs      135.02 μs
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="137525" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/cubdb-a-pure-elixir-embedded-key-value-database/23397/40">Post #39</a>
	                </div>
	            </div>
              <div id="likers-container-137525" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="137525"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #39"></div>
  </section>
</div>
    <div class="postbit" id="137544" data-post-id="137544">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lucaong" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lucaong/120/21794_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lucaong
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks for posting your benchmark <a class="mention" href="/u/dch" rel="nofollow">@dch</a>, that’s really awesome!</p>
<p>Yes, I agree that snappy compression could be a good way to introduce compression without the huge performance penalty observed with the standard erlang term compression (I hope it might even improve performance with large values). I will experiment with it.</p>
<p>I also think that the current benchmark is hiding the true benefits of compressions, as the value being written is essentially random bytes, so it won’t be compressed much.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="137544" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/cubdb-a-pure-elixir-embedded-key-value-database/23397/41">Post #40</a>
	                </div>
	            </div>
              <div id="likers-container-137544" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="137544"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #40"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/23397/load_more?page=5">Load more posts (84 remaining)</a>
</div></template></turbo-stream>