Rpi – a Rust rewrite of the Pi agent, 10× faster startup

1 points by bigfishhk ↗ HN
I've been learning about the Pi agent and decided to rewrite it in Rust. Now that I've finished a lot of the work, I'd like to show how much faster Rust (rpi) is than TypeScript (Pi). Here are the results:

| Metric | rpi (Rust) | Pi (TypeScript) | Difference | |:---|:---|:---|:---| | `--version` | 17.5 ms | 169.5 ms | 9.7× faster | | Cold start | 17.7 ms | 189.5 ms | 10.7× faster | | RSS when ready | 12.0 MiB | 91.5 MiB | 7.6× smaller | | Install size | 21.8 MiB | ~385 MiB | ~18× smaller |

Rust is really cool!

14 comments

[ 1.4 ms ] story [ 23.9 ms ] thread
This kind of invalidate the pitch of Pi, the self-modifying harness. You can't use the Pi extensions I'm assuming...

Without a plan of your own for extensions this is comparing apples to oranges. My Pi startup time is dominated by loading extensions and skills, and I don't even have many to begin with!

I wonder about adding a plugin shim for webassembly, or a Rust crate with integrated V8 engine (Bun?). But honestly, I use pi and I have yet to ask it to self-modify.
I mean, kinda same. I've asked it to write skills but that is about it. And skills dont require this. But I do use other peoples extensions.
I suppose one potential drawback is that the visibility of the logic of a plugin is inherent in the pi ts extensions, and unless it's shipped with the rpi (pi-rust) extension, it may not be the same to use it. There are instances where I've seen pi go digging around in it's own docs & code to figure out how to do something.
There is a tool named Docs that guides users on how to use RPi and how to write extensions. RPi has a plugin ABI to support extensions.
That name won't be confusing at all
The table corrected:

  Metric          rpi (Rust)   Pi (TypeScript)   Difference
  --version       17.5 ms      169.5 ms          9.7x faster
  Cold start      17.7 ms      189.5 ms          10.7x faster
  RSS when ready  12.0 MiB     91.5 MiB          7.6x smaller
  Install size    21.8 MiB     ~385 MiB          ~18x smaller
How would you handle a co-founder whose commitment appears to have changed?
I'd make him use Claude Code
en...even rust seems like more fast.But, for a coding agent in cli,this is not necessery.The important things is the community and extension.Pi agent in ts not slow.