News for hackers. Stuff that matters.
Re:Under Deconstruction: The State of Shopify’s Monolith by skipants on Thursday September 17, 2020 @04:01PM (#24509262)
I just want to caveat this as it is not a Ruby construct, it's part of Ruby web servers. Because they are long-living Ruby processes they are only loading files once (I suppose it's similar to compiling). This means it runs all globally-scoped code, which class definitions and constants (generally) are. That's actually what Ruby bootloaders like Spring and Zeus are doing on your dev machine to speed up the load time when you use Rails commands. They cache all that globally run stuff in their own process. It's also why they run into a bunch of issues when you have logic in your constant definitions.

There are no comments on this comment yet.