Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

can LLMs optimize anything?


Absolutely. LLMs get a lot of hate but sincerely, GPT-4o can be given a hunk of code (one function/small class worth) and told to find optimization opportunities, and it will do a great job, especially considering the 30s it takes to ask,

It’s not perfect, but it understands lock-free algorithms, branch prediction, can tell you which memory order to use for atomic operations if you’re using too strong of an ordering, AND it will catch silly bugs at the same time. I had a bounds check in a lock-free algorithm I was optimizing, which equated to if(idx < start && idx >= end) return false, and it mentioned that error while optimizing.

This guy was really putting it through its paces on already highly optimized code in an esoteric architecture (Nintendo 64) and it still found a few things: https://youtu.be/20s9hWDx0Io


They optimised my coding speed for sure.


Yes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: