LLMs are quite good at optimization. Here is a simple prompt - rewrite this crap from electron to rust + whatever time tested ui framework. And now we have 80% less ram usage.

To be fair electron to rust would probably work even with LLM ram overhead