35 pointsby swaminarayan2 hours ago7 comments
  • ThrowawayR29 minutes ago
    [delayed]
  • franticgecko32 hours ago
    OP seems to self promote this project and other similar vibe coded works every few weeks under two different HN handles.

    Edit: for me this post appears on the front page of HN. OP this is mission success - add this project to your résumé and stop spamming.

    • swaminarayan30 minutes ago
      this is not vibe coded project, this is developed by understanding sqlite code. Have you ever looked into examples ? Have you checked the code ? Now my post got flagged. and If I use AI to understand code than what is wrong with that ? what is the use of AI ? to make person more productive, right ?
    • gjgtcbkj2 hours ago
      Yeah I wish substack would stop doing this too. They keep inserting their brand in HN under different handles.
  • Retr0id2 hours ago
    I'm surprised by your benchmark results.

    I've considered building this exact thing before (I think I've talked about it on HN even), but the reason I didn't build it was because I was sure (on an intuitive level) the actual overhead of the SQL layer was negligible for simple k/v queries.

    Where does the +104% on random deletes (for example) actually come from?

    • swaminarayan2 hours ago
      Fair skepticism — I had the same intuition going in.

      The SQL layer overhead alone is probably small, you're right. The bigger gain comes from a cached read cursor. SQLite opens and closes a cursor on every operation. SNKV keeps one persistent cursor per column family sitting open on the B-tree. On random deletes that means seek + delete on an already warm cursor vs. initialize cursor + seek + delete + close on every call.

      For deletes there's also prepared statement overhead in SQLite — even with prepare/bind/step/reset, that's extra work SNKV just doesn't do.

      I'd genuinely like someone else to run the numbers. Benchmark source is in the repo if you want to poke at it — tests/test_benchmark.c on the SNKV side and https://github.com/hash-anu/sqllite-benchmark-kv for SQLite. If your results differ I want to know.

      • Retr0id2 hours ago
        What does "column family" mean in this context?
        • swaminarayan2 hours ago
          A named key space within the same database file — keys in "users" don't collide with keys in "sessions" but both share the same WAL and transaction.
          • bflesch2 hours ago
            Did you measure the performance impact of having multiple trees in a single file vs. having one tree per file? I'd assume one per file is faster, is that correct?
            • swaminarayanan hour ago
              no dont know about it. I will check it out.
      • d1l2 hours ago
        Are you using ai for the comment replies too?!
        • derwiki2 hours ago
          Everyone knows the emdash is a giveaway, and they are being left in
      • altmanaltman2 hours ago
        are you reading what you're writing?
        • swaminarayanan hour ago
          yes
        • d1l2 hours ago
          It's a nonstop slop funnel as far as I can tell. Only ashamed I've been here for more than 5 minutes.
    • snowhalean hour ago
      the benchmark probably controls for this implicitly but wondering if they used prepared statements in the sqlite baseline. the query planner overhead is negligible for a simple put/get after the first parse, but the vtable dispatch and statement compilation on every call can add up. if the baseline is using raw sqlite3_exec strings rather than prepared + bound params, that would explain a chunk of the gap.
    • nightfly2 hours ago
      It "only" doubles performance so the overheads aren't that heavy
  • woadwarrior012 hours ago
    Related: lite3[1] a binary JSON like serialization format using B-trees.

    [1]: https://github.com/fastserial/lite3

    • swaminarayan35 minutes ago
      I just looked into .c files into it, it is not using any of sqlite files. In my project I am using only sqlite layers, which are battle tested.
  • rurban2 hours ago
    It doesn't beat a hashtable, but has faster sequential (=ordered) reads, and can do range iterators. The examples to not reflect that.

    All random accesses are slower.

    • 2 hours ago
      undefined
  • d1l2 hours ago
    Vibe coded trash.

    that credulous hn readers will upvote this is alarming.

    • swaminarayan15 minutes ago
      this is not vibe coded project, this is developed by understanding sqlite code. Have you ever looked into examples ? Have you checked the code ? Now my post got flagged. and If I use AI to understand code than what is wrong with that ? what is the use of AI ? to make person more productive, right ?
    • tlb2 hours ago
      What's the evidence that this is vibe-coded? Or trash?
      • d1lan hour ago
        If you can't tell then I'm not sure what more needs to be said. I took a look through the commit history and it was glaringly obvious to me.

        To trust something like data-storage to vibe-coded nonsense is incredibly irresponsible. To promote it is even moreso. I'm just surprised you can't tell, too.

      • jitl2 hours ago
        the readme seems like it was written to some degree by claude. if u work long enough with claude u start to pick up on its style/patterns
      • debugnikan hour ago
        I don't know about trash, but this post, this repo and even their comments on this thread are blatantly written by an AI. If you still need to ask for evidence, consider that you might be AI-blind.
  • m00dy2 hours ago
    I did the same on rust, sqlite btree behind actix. It is amazing that you don't need redis anymore.
    • silon422 hours ago
      You never did if you're happy with local files. See dbm, gdbm, Berkeley DB...