6 comments

  • Retr0id48 minutes ago
    &gt; A 100-bit bloom filter holding 100,000 keys is saturated instantly<p>&gt; This is the kind of bug you only find by building the thing and measuring it.<p>No? I mean, maybe if you&#x27;re vibecoding it&#x27;s the only way, but in the prehistoric days you could reason about what code would do before you ran it.
    • bawolff39 minutes ago
      Mistakes are always easy to recognize in retrospect, so hopefully this comment isnt too unfair, but one thing that caught me about this, is that logically it makes no sense. You would never use a bloom filter for just 10 entries. If you have only 10 entries it is almost certainly faster to skip the bloom filter. So i feel like that is the part that should have instantly stood out.<p>[Obviously, i&#x27;ve made my own silly mistakes over the years, many much sillier than this, its just weird to describe this one as only detectable by profiling]
      • FarmerPotato30 minutes ago
        Sure, it logically makes no sense. But <i>while learning</i> a new subject, have you never made a silly mistake like:<p>bool getSchemaSizes(size_t * expectedBatchSize, size_t * expectedEntriesPerBlock) { ... }<p>size_t expectedEntriesPerBlock, expectedBatchSize;<p>getSchemaSizes(&amp;expectedEntriesPerBlock, &amp;expectedBatchSize)<p>initBloomFilter(expectedEntriesPerBlock)
        • bawolff28 minutes ago
          I said as much in my comment.
    • tensegrist15 minutes ago
      i don&#x27;t know why you&#x27;re trying to analyze the meaningfulness of sentences that are not the results of a human thought process but are clearly rhetorical flourishes from an llm that &quot;feels&quot; compelled to fill its prose with them
      • Retr0id12 minutes ago
        Comments that explicitly call out an article as slop tend to get downvoted (or disagreed with), it&#x27;s best to guide the reader towards their own conclusions.
    • paulb738 minutes ago
      Isn&#x27;t this what units tests are for?
    • ignoreusernames34 minutes ago
      Yeah, especially a bloomfilter which has a pretty easy formula for its false positive rate.
      • jasonwatkinspdx27 minutes ago
        A lot of people know the basic rule of thumb that a byte per element gives you a bit more than a 1% false positive rate.<p>But even just thinking about it for half a second from a balls and bins perspective, 100k items into 100 binary bins is obviously gonna saturate.
    • FarmerPotato37 minutes ago
      Do you think the author is somehow capable of writing the entire codebase, but not able to reason about code???<p>I&#x27;m sure you&#x27;ve never made a silly mistake where you passed the wrong integer parameter to a function, stared at your screen, and failed to notice it. Or, forgot the order of arguments to calloc().<p>If you&#x27;re saying that profiling is for those too lazy to reason about their code, you&#x27;re distorting the whole lesson: profiling is more powerful than guessing.
      • Retr0id27 minutes ago
        I make all sorts of silly mistakes, but I&#x27;d rarely say that running the code is the <i>only</i> way to detect issues.<p>I also don&#x27;t think the author wrote much of their codebase, or much of their blog post, but that&#x27;s the brave new world we&#x27;re living in.
      • shermantanktop31 minutes ago
        I&#x27;m called in to consult on a performance problem on a scaled service. Team was load testing their code and seeing low throughput:<p>Me: so you have an in-memory cache, right?<p>Them: yes!<p>Me: what is the TTL?<p>Them: Oh, it&#x27;s not set, oops. Here, let&#x27;s set it to 1 minute. Hey look, the performance went way up!<p>Me: okay, great. When you say 1 minute, do you mean 60 seconds?<p>Them: uh...wait...uh....oh, the unit is seconds. Wait, why is the performance so good with a 1 second TTL?<p>Me: What&#x27;s your load test?<p>Them: We crank 1M TPS fetching the same 30 items over and over.<p>Me: ....<p>I totally agree about the power of profiling but profiling without understanding would not have helped this team.
        • FarmerPotato25 minutes ago
          So the author is doing a self-learning exercise about profiling pre-production code, and you&#x27;re disagreeing with them by comparing it to a commercial contract. I&#x27;m sure you&#x27;ve never, ever made a dumb mistake while getting paid.
      • achierius35 minutes ago
        No, that&#x27;s not the point. This isn&#x27;t a situation where you need to &quot;guess&quot;; bloom filters should be sized according to their capacity. This is akin to having a fixed 10-arg buffer for your program, getting a crash when someone passes 11, and saying &quot;this is the kind of bug you only find by building the thing and measuring it&quot;. Yeah it happens and we all make silly mistakes, but it&#x27;s just not true that this couldn&#x27;t have been foreseen.
      • FarmerPotato27 minutes ago
        Cool! My first downvote!
  • sheepcow27 minutes ago
    &gt; A few weeks ago I wanted to understand how the storage engine inside RocksDB actually works. Not read about it. Build it.<p>Immediate tell that this was written by AI. Another thing I&#x27;ve noticed lately - AI&#x27;s overuse of &quot;every&quot;:<p>&gt; Every batch of writes called `file.Write` on the write-ahead log.<p>&gt; Every read was scanning entire SSTable files.<p>&gt; Every bit is set.<p>&gt; Every value matches.
  • teraflop37 minutes ago
    The article doesn&#x27;t link to it but this appears to be the repo in question: <a href="https:&#x2F;&#x2F;github.com&#x2F;AasheeshLikePanner&#x2F;lsm-tree-go" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;AasheeshLikePanner&#x2F;lsm-tree-go</a><p>I&#x27;m very amused by this obviously AI-generated &quot;benchmark program&quot;: <a href="https:&#x2F;&#x2F;github.com&#x2F;AasheeshLikePanner&#x2F;lsm-tree-go&#x2F;blob&#x2F;main&#x2F;bench&#x2F;fulltable.go" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;AasheeshLikePanner&#x2F;lsm-tree-go&#x2F;blob&#x2F;main&#x2F;...</a>
  • jmalicki1 hour ago
    Writing to disk for every write is required, otherwise you&#x27;re not durable.<p>Sure it&#x27;s faster to never write to disk, then you reboot and you&#x27;ve lost data.<p>&#x2F;dev&#x2F;null is a webscale database that is even faster!
    • Retr0id34 minutes ago
      There are a lot of use cases where you only truly need consistency, and durability can take a back seat. RocksDB for example does not fsync its WAL writes in the default configuration.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;rocksdb&#x2F;wiki&#x2F;WAL-Performance#non-sync-mode" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;rocksdb&#x2F;wiki&#x2F;WAL-Performance#non...</a>
      • jmalicki20 minutes ago
        If you can&#x27;t at least guarantee write <i>ordering</i> you don&#x27;t even have consistency.<p>Fsync is often used when the data doesn&#x27;t truly need to be on disk, because there aren&#x27;t very good write ordering APIs exposed, even if that&#x27;s all you truly need.
    • FarmerPotato55 minutes ago
      read the whole article. WAL is the transaction log and the author tested correctness after a crash.
      • teraflop34 minutes ago
        Well, the thing about reliability is that you can&#x27;t really guarantee it by testing one particular scenario.<p>It seems to me that neither the old nor the new version of the code is really &quot;durable&quot; as I would understand the word. The old version made a write syscall per batch, but doesn&#x27;t say it also did an fsync per batch. The new version writes data to an mmap&#x27;ed file, and calls fsync in the background.<p>So both versions are &quot;durable&quot; in the sense that written data is preserved even if the process gets killed, because it&#x27;s in the OS page cache. But in both versions, a write can be completed before the data actually makes it to disk, so a power failure will lose acknowledged writes.
      • bawolff37 minutes ago
        They tested SIGKILLing the process, they didn&#x27;t test a power loss situation.
      • jmalicki50 minutes ago
        &quot;Every batch of writes called file.Write on the write-ahead log&quot;<p>You don&#x27;t write to the WAL on a batch.<p>&gt; the author tested correctness after a crash.<p>You mean the LLM?
  • dj_axl52 minutes ago
    &gt; A 100-bit bloom filter holding 100,000 keys is saturated instantly. Every bit is set. It returns “maybe present” for every key you ask about — which means it filters nothing, and every read falls through to a full file scan.<p>Hahaha. (Seems like the bloom filter library isn&#x27;t set for maximum false positive rate and&#x2F;or to autoexpand.)<p>Edit: Actually there&#x27;s a BloomFalsePositive setting, maybe it never gets used? Also maybe it&#x27;s not a library and it&#x27;s a custom implementation.
    • FarmerPotato43 minutes ago
      I guess you&#x27;ve never made a silly mistake, found it, and admitted it.<p>The author wrote this as a learning exercise. And is sharing the process.
  • AtlasBarfed48 minutes ago
    Your right should go into a queue and get compacted later on?<p>That&#x27;s what Cassandra does iirc