Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
malisper
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
61.
▲
by
malisper
3mo ago
Can you elaborate on the use case for query multiplexing? Is it so your client would only need to establish one connection with Postgres and then could run as many queries as it wanted?
62.
▲
by
malisper
3mo ago
> The rewrite also could have simpler code in some cases The Rust code is a literal translation of the Postgres code which returns the value at the end instead of an early return. > I see a lot of MemoryContext MemoryContext in C is u
63.
▲
by
malisper
3mo ago
Yep! The new version of pgrust supports batch based execution and a columnar format. I'm curious how you got δx to perform that well? From what I've seen a columnar layout only gets you part of the way and really good parallelism
64.
▲
by
malisper
3mo ago
Rust actually made the change pretty simple. The main changes are: - Use thread local variables - Move everything from shared memory to process memory - Use threads instead of processes I've started to see meaningful benefit
65.
▲
by
malisper
3mo ago
> why is the parser unsafe at all?!? The parser was generated by c2rust. The Postgres parser is generated from yacc/bison itself so I didn't bother making it idiomatic.
66.
▲
by
malisper
3mo ago
Note that most of the unsafes are confined to the parser which was generated by running c2rust over the Postgres parser. The Postgres parser is itself generated from yacc/bison, so I decided to port it over mechanically rather than idi
67.
▲
by
malisper
3mo ago
Note that the code I believe you are referring to is from the parser which was generated with c2rust. The Postgres parser is generated from yacc/bison so rather than try to rewrite it idiomatically, I did so mechanically.
68.
▲
by
malisper
3mo ago
The 50% is specifically on percona-tpcc[0]. I got there through a mix of batching (postgres processes a row at a time), prefetching, and several handful of other optimizations. [0] https://github.com/Percona-Lab/sysb
69.
▲
by
malisper
3mo ago
It is theoretically possible to have a Rust port of Postgres support extensions. If you make all the relevant functions and structures ABI compatible with Postgres, extensions should work. The issue is the moment you're dealing with C
70.
▲
by
malisper
3mo ago
The version in the GitHub repo is ~8x slower than Postgres. I have a new unpublished version that is 50% faster than Postgres on transactional workloads and ~300x faster on analytical workloads.
71.
▲
by
malisper
3mo ago
It's not used in production. I've been using different benchmarks to compare the performance vs other systems. Namely sysbench-tpcc[0] and clickbench[1] [0] https://github.com/Percona-Lab/sysbench-tpcc [1] h
72.
▲
by
malisper
3mo ago
I'm not sure what you mean? The rust code you're showing mimics the Postgres code: https://github.com/postgres/postgres/blob/2e6578292a9184dcaa... The boolean being returned is the return value of t
73.
▲
by
malisper
3mo ago
Hey author here. Wasn't expecting to see this up. To concisely give an overview of the project, I've been experimenting with using LLMs to build a better version of Postgres. Postgres is 30 years old and we've learned a lot a
74.
▲
by
malisper
3mo ago
If you want to follow along, I've been writing about it on my blog ( https://malisper.me/ ) an you can follow the github repo here: https://github.com/malisper/pgrust
75.
▲
by
malisper
3mo ago
I can confirm a naive rewrite won't make things faster. I've been working on rewriting Postgres in Rust. I rewrote things function by function similar to how Jarred did. Even though the new Rust code mapped closely with the previo
76.
▲
by
malisper
3mo ago
> Maybe the takeaway is that 20% is about all the LLM can muster At this point there's a long list of projects that have used LLMs to rewrite a system in Rust including: - Bun (https://github.com/oven-sh/bun&
77.
▲
by
malisper
3mo ago
> But LLMs are great at this Not really. The latency for an llm to make a single change is on the order of seconds. If in order to change a single function from unsafe Rust to safe rust requires thousands of changes, it will take hours t
78.
▲
by
malisper
3mo ago
I made a comment about this yesterday[0], but there's been a massive increase in people migrating from C to Rust due to LLMs. In contrast to what the C to Rust migration book is recommending (using FFI to integrate Rust with C), I'
79.
▲
by
malisper
3mo ago
A meta-trend I find interesting is there's a lot of projects using AI to rewrite existing systems in new programming languages. Most often in Rust. 1. Bun rewritten in Rust 2. Flow rewritten in Rust 3. The react compiler was re
80.
▲
Show HN: Pgrust, Postgres in Rust (passing 100% of Postgres regression tests)
(github.com)
6 points
by
malisper
3mo ago
|
1 comments
81.
▲
by
malisper
4mo ago
> Isn't concurrency also limited by your machines disk speed for writes, what difference does it make if you write sequentially vs concurrently? Why does concurrency even matter for databases? For a simplified example, having three
82.
▲
by
malisper
5mo ago
There's a few big differences between the Anthropic C compiler and pgrust. The C compiler was built mostly autonomously and as a clean room implementation. OTOH I'm steering codex and using the Postgres source code as a reference.
83.
▲
by
malisper
5mo ago
I wrote up a bit about my workflow here[0][1]. I'm using conductor.build to manage multiple codex sessions at once. When I hit the rate limit, I'm using codex-auth[2] to switch codex accounts. [0] https://malisper.me&#x
84.
▲
by
malisper
5mo ago
Same but for multi-threaded Postgres[0]. 96% pg regression tests pass after 1 month and 823K LOC. 8 Codex accounts at $200/mo is what i could use up with no Mythos I've also seen the benefits of Rust for this too. And making the b
85.
▲
by
malisper
5mo ago
> what looks like a massive undertaking for vibe coding fwiw, I suspect it's less of an undertaking than you may think. I've been playing with AI to rewrite Postgres in Rust[0] over the past couple of weeks and I found the AI t
86.
▲
by
malisper
5mo ago
I've been working on a project to build a new Postgres based database in Rust[0]. I'm four weeks in and have 93% of the Postgres test suite passing. I've found agents to have worked really well for this as I have an existing
87.
▲
by
malisper
7mo ago
Since there's a lot of questions about what this means, let me explain. Anthropic has two different products that are relevant here: the Claude API and Claude Code. The Claude API has usage based pricing. The more you use, the more you
88.
▲
Freshpaint (YC S19) Is Hiring a Senior SWE, Data
(freshpaint.io)
1 points
by
malisper
8mo ago
89.
▲
by
malisper
10mo ago
Three consecutive months of decline starts to look more like a trend. Unless you think there's a transient issue causing the decline, something fundamental has changed
90.
▲
by
malisper
10mo ago
From the chart, the percentage of companies using AI has been going down over the past couple of months That's a massive deal because the AI companies today are valued on the assumption that they'll 10x their revenue over the next
More ›