config icon indicating copy to clipboard operation
config copied to clipboard

Cache configs by group

Open rustamwin opened this issue 3 years ago • 5 comments
trafficstars

Caching configurations can improve performance.

Proposal:

cache each config group to one file

  • web.php
  • console.php
  • providers-web.php
  • providers-console.php
  • etc

rustamwin avatar Mar 31 '22 08:03 rustamwin

We're tried that. Caching requires serialization/deserialization for many constructs we can't directly dump and the process of de-serialization proved to be slower than doing many require calls. It was quite a long time ago though, maybe it worth re-checking it.

samdark avatar Mar 31 '22 08:03 samdark

We're tried that. Caching requires serialization/deserialization for many constructs we can't directly dump and the process of de-serialization proved to be slower than doing many require calls. It was quite a long time ago though, maybe it worth re-checking it.

At least only params.php can be cached. In params contains almost arrays. WDYT?

rustamwin avatar Mar 31 '22 09:03 rustamwin

We're tried that. Caching requires serialization/deserialization for many constructs we can't directly dump and the process of de-serialization proved to be slower than doing many require calls. It was quite a long time ago though, maybe it worth re-checking it.

At least only params.php can be cached. In params contains almost arrays. WDYT?

we don't can sure that params contain only scalar values and without serialization this cannot be done.

vjik avatar Mar 31 '22 10:03 vjik

We're tried that. Caching requires serialization/deserialization for many constructs we can't directly dump and the process of de-serialization proved to be slower than doing many require calls. It was quite a long time ago though, maybe it worth re-checking it.

At least only params.php can be cached. In params contains almost arrays. WDYT?

For example, in the parameters, a static method call: https://github.com/yiisoft/app/blob/master/config/params.php#L43

devanych avatar Mar 31 '22 10:03 devanych

Also https://github.com/yiisoft/classifier should be cached to reduce IO operations.

xepozz avatar Apr 19 '22 11:04 xepozz