3 comments

  • landhar 14 minutes ago

      > Normally, when engineers try to make software faster, they work from the bottom up. They run a benchmark, look at a flamegraph, find a hotspot, and figure out how to speed up their code by 15% or 20%. The problem with working from the bottom up is that you don't know what the ceiling is. You might be 20% away from the fastest possible code the hardware can run, or you might be 100x away.
      > When we started building Gravity, we flipped this question around. We asked ourselves: how fast can a database actually be? Instead of incrementally speeding up our existing query engine, we wanted to start from the physical speed limit of our hardware and file format and work backward. I like to call this “programming at light speed”.
    
    What is described as the “normal” approach to optimizing code is really more the “naïve” approach. Any serious performance optimization work would follow the approach of defining first what’s the ceiling the hardware allows and benchmark against that. And that was already true before LLMs.

    See for example: https://www.marginalia.nu/log/a_106_native_calls/

    Apologies for being nitpicky, but I felt it might be useful for other readers to contextualize that this part of the approach is not novel. Their use of Claude to generate those optimized benchmarks is interesting enough already, so I don’t feel that calling extra attention to this part in their write up is necessary.

  • cube2222 46 minutes ago
    After the recent somewhat discouraging stuff with clickbench that made the news, I must say this blog post is very cool.

    Sounds like you found an excellent way of structuring this problem to solve it with Claude (for those who don't click into the article - writing hand/claude-optimized Rust code for each query, checking its assembly, and trying to make their own optimizer generate something close to that same assembly), and the writeup is very interesting and readable too!

    Kudos, looking forward to more blog posts like this one.

  • agumonkey 42 minutes ago
    Are the pgrust guys lisper historically ?
    • code_martial 38 minutes ago
      Not answering your question directly, but FWIW, that’s the default IR notation Claude reaches for.
      • agumonkey 35 minutes ago
        oh really ? I never poked at that kind of problems using claude. still interesting that claude's training placed lisp at the top for IR stages.. even though historically it's obviously one of the culture that worked on interpretation and compilation the most, it's not mainstream. But I guess for sql engine teams, it decided that it was perfectly on point.