The downside would be that it makes preloading for copy-on-write in all serious (persistent) environments harder.
Is micro optimizing for CGI really worth it?
--
Sebastian Riedel
http://blog.kraih.com
http://mojolicious.org
http://twitter.com/kraih
> > I think always loading Mojo::Client is too heavy in the environment
> > like CGI. And, this module is not used at all when not used.
> >
> > Therefore, I suggest to lazy load Mojo::Client. Startup time has
> > decreased about 20% by this improvement in my environment. Of course,
> > in the environment doesn't use Mojo::Client at all.
>
> The downside would be that it makes preloading for copy-on-write in all
> serious (persistent) environments harder.
I would think not a log harder. You know in ->start() whether the
environment is CGI or not.
> Is micro optimizing for CGI really worth it?
If 20% doesn't matter for CGI, then maybe preloading for copy-on-write
doesn't matter for other environments? Maybe performance tuning should
be left to those doing deployment, so you should make it possible
(without patching).
---
Charlie
And now you've created multiple mostly untested startup scenarios... a maintainability mess.
And thats only the beginning, if we make the client lazy loading why not continue with websockets or the multipart parser?
Without thinking further this might seem like a simple decision, but there are always consequences to strategic decisions like this one.
In the end everything is a tradeoff.
>> Is micro optimizing for CGI really worth it?
>
> If 20% doesn't matter for CGI, then maybe preloading for copy-on-write
> doesn't matter for other environments? Maybe performance tuning should
> be left to those doing deployment, so you should make it possible
> (without patching).
Memory consumption has nothing to do with performance in persistent environments, it's about scalability.
And those 20% are for a Hello World application, a micro benchmark without any relation to the real world.
Conclusion: This change might not result in any performance improvements for real world applications but will for sure have a serious impact on maintainability.
> Memory consumption has nothing to do with performance in persistent
> environments, it's about scalability. And those 20% are for a Hello
> World application, a micro benchmark without any relation to the real
> world.
>
> Conclusion: This change might not result in any performance improvements
> for real world applications but will for sure have a serious impact on
> maintainability.
OK, sounds good thinking.
---
Charlie