Best ways to optimize Ruby code for performance?

Hey everyone,

I’ve been digging into some Ruby projects lately and noticed a few slow spots, especially when handling larger datasets. I’m curious—what are your go-to methods for optimizing Ruby code? Any favorite gems or profiling tools?

Also, slightly off-topic, but while prepping for some Machine Learning Interview Questions, I realized how much performance matters—even in Ruby scripts that support data tasks.

Would love to hear your tips, lessons learned, or even what not to do.
Thanks