yiisoft / config

Configuration management
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
31 stars 11 forks source link

Cache configs by group #115

Open rustamwin opened 2 years ago

rustamwin commented 2 years ago

Caching configurations can improve performance.

Proposal:

cache each config group to one file

samdark commented 2 years ago

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.

rustamwin commented 2 years ago

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?

vjik commented 2 years ago

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.

devanych commented 2 years ago

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

xepozz commented 2 years ago

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