Hi! I've noticed a slight performance issue using this gem and found out that by using standard Setting.app_name getters cache is hit twice and it takes twice as long to get the value. By using RailsSettings.config.cache_storage.fetch('rails-settings-cached')['app_name'] cache is hit once and the value returns twice as fast. This can be fixed by memoizing the return value of saved_value method here: https://github.com/huacnlee/rails-settings-cached/blob/main/lib/rails-settings/fields/base.rb#L36
Or is there a reason for this behavior? Thank you for your work, gem is great!
Hi! I've noticed a slight performance issue using this gem and found out that by using standard
Setting.app_name
getters cache is hit twice and it takes twice as long to get the value. By usingRailsSettings.config.cache_storage.fetch('rails-settings-cached')['app_name']
cache is hit once and the value returns twice as fast. This can be fixed by memoizing the return value of saved_value method here: https://github.com/huacnlee/rails-settings-cached/blob/main/lib/rails-settings/fields/base.rb#L36Or is there a reason for this behavior? Thank you for your work, gem is great!