You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our app we (ab)use Environment::set() when bootstrapping to set all of our site's configuration. We set some defaults, and then depending on our environment (prod/test/dev) we overwrite some of those.
I was just trying to improve my app's performance and I've found that Environment::set() uses Set::merge() which is kinda slow.
Sometimes you want to set some configuration overwriting the existing values. Perhaps I'm misusing this class.
Example:
<?php// This is slowEnvironment::set(true, ['assets' => $foo + Environment::get('assets')]);
// This is fast$bar = $foo + Environment::get('assets');
Environment::set(true, ['assets' => null]);
Environment::set(true, ['assets' => $bar]);
The text was updated successfully, but these errors were encountered:
Initial set has been minimally optimized in 1e7b327. Set::merge seems already pretty optimized, but maybe someone might want to give it a try. @fedeisas Benchmarks showing the differences (and where time is spent) between the two cases outlined in your report would help.
Hi!
In our app we (ab)use
Environment::set()
when bootstrapping to set all of our site's configuration. We set some defaults, and then depending on our environment (prod/test/dev) we overwrite some of those.I was just trying to improve my app's performance and I've found that
Environment::set()
usesSet::merge()
which is kinda slow.Sometimes you want to set some configuration overwriting the existing values. Perhaps I'm misusing this class.
Example:
The text was updated successfully, but these errors were encountered: