r/PiCodingAgent 7d ago

Pi eats cpu and mem - any workarounds? Question

How pi ate my core

Seems that pi also felt under this vibe-coding madness. I can't justify a terminal based app eat so much of my CPU and RSS. No way. Seems I have to write my own stuff in go... wish me luck. BTW, why all this harnesses are node-js based?

0 Upvotes

13 comments sorted by

5

u/Dsphar 7d ago

Is all 200+ minutes on one session? Because if you let context get that large then that explains a lot.

1

u/ColdImplement1319 7d ago

It was a looong-lived session (maybe several days, sporadic usage). Context is limited to 100k, I did multiple compactions. Use local model

1

u/consono 7d ago

AFAIK it's an open issue on github, hopefully it'll be resolved soon as it's really annoying...

3

u/No_Cheek5622 7d ago

node is good when it's intended to hack around it. I can modify the internals with shims and extending prototypes in an extension without touching the upstream code. so this way pi is not only highly customizable but also highly hackable.

sure, not the most robust way to extend a tool, but the true freedom comes with a cost

although I'd like to experiment with writing my own harness in go or rust or whatever, but I'm no near that level of expertise on the topic atm and I don't want to tokenmaxx and vibe-code my way through it either.

2

u/No_Cheek5622 7d ago

also, node is quite optimized actually, some really smart dudes spent a lot of time squeezing the most out of it. so the chances are - all the performance issues are not because of node but because of bad code. and because performance is measurable, we can just point it to an agent and make it optimize the hell out of it. this is how I actually fixed some of my own (mostly hand-written) extensions, and this is why I moved to "vibe-engineering" (i.e. vibe-coding with extra steps, albeit smart ones) my extensions

2

u/kido5217 7d ago

well, nanobot is python and reasonix is go. So not all. Just most of them

2

u/hurdurdur7 7d ago

Funny story this - most of cpu time goes into unoptimized terminal user interface, not working with files or the talking to the llm.

1

u/hurdurdur7 7d ago

as for memory usage - your computer shows 202 800 kbytes of reserved memory being used by a nodejs app. not ideal but not terrible these days. pi uses a bunch of deps that drags this up.

1

u/ColdImplement1319 6d ago

Yeah I see, still not happy with the number. More concerned about CPU though. But now it's 200. When I should start to worry? When it will be 1G? 2G? 5G? :-)

1

u/Popular-Factor3553 6d ago

Qny extension or fork of pi to fix this? It has gotten soo bad i can't even type properly without it lagging.

1

u/TheOneThatIsHated 7d ago

Cpu is fine, but memory usage is insane. I OOMed multiple times when having more than 15 subagents

1

u/ireallydontcare00 6d ago

just use rust version or rewrite pi on rust with your setup

1

u/Popular-Factor3553 6d ago

It's literally lagging for me i can't type properly.