ZiggyCreatures / FusionCache

FusionCache is an easy to use, fast and robust hybrid cache with advanced resiliency features.
MIT License
1.56k stars 84 forks source link

[FEATURE] ⚡ Add `PreferSyncSerialization` option #245

Closed jodydonetti closed 1 month ago

jodydonetti commented 2 months ago

Problem

Not really a problem, but it has been observed that in some situations async serialization and deserialization can be slower than the sync counterpart: this has nothing to do with FusionCache itself, but how serialization works in general.

It would be nice to allow users to specify a preference.

Solution

Add a new option called PreferSyncSerialization, that can allow the sync version to be preferred.

The default would be false for full backward compatibility.

jodydonetti commented 2 months ago

Hi all, I just released v1.2.0-preview1 🥳

viniciusvarzea commented 2 months ago

Hello @jodydonetti, yeah, since async serialization/deserialization works well with streams comming from io tasks (network streams, file streams etc), for memory streams the sync versions works alittle better. The adittion of this parameter will help us to have a better performance.

jodydonetti commented 1 month ago

Hi all, FusionCache v1.2.0 is out 🥳