by xtracto · 1w ago · 0 comments
Thing is, the TS app weighted around 4GB overall and took 2s to do its thing. [A backend process, an http api and a static website generator].
I needed to decrease the size and increase performance dramatically,to be able to put it in a 2GB 2vcpu instance, which costs $12 monthly. Otherwise it would eat the profit.
Claude ported it to Rust, in around 2 days total. And it went down to 1.5Gb max, and 1/10 of the CPU usage. Now it sits in the aws europe zone making money.
Apparently a lot of the node baggage was due to Garbage Collection, which Rust doesn't need. Also, immediately transforming incoming JSON to binary data helped.
Yes, to both: claude wrote the initial architecture, under my guidance. As I mentioned it was a PoC, so the first pass was "quick and dirty". Shit the original web server was React [which i didn't count for the comparison because barebones node can serve static pages as well.
It has been a cool experiment which started as a crazy idea, but now as I said gives me some spare change. I just SSH tunnel every day or two and load the web page to see how things are going.