7 ms·
>Think about how ActiveRecord in Rails reads from the DB schema to generate it's magic methods, etc. All the magic you ever need can be dynamically created in
by colllectorof 10y ago
>Think about how ActiveRecord in Rails reads from the DB schema to generate it's magic methods, etc.
All the magic you ever need can be dynamically created in __get, __set and __call. It works, it works well, and it makes not only reasoning, but also deployment an order of magnitude simpler.
>Code paths, auto-loaders, database connections, config files, etc.
Use a single code path, a single autoloader and a single database connection. Cache the opcodes of stuff you load. Write config files and templates in pure PHP, so they're cached as well. Done.
I've never, ever had problems with bringing PHP page generation time below .1 seconds. Usually it took something like .03 seconds on crappy hardware. And that was without extensive caching of DB results or anything else that's particularly clever.