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
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!
The text was updated successfully, but these errors were encountered:
qichunren
added a commit
to qichunren/rails-settings-cached
that referenced
this issue
Dec 9, 2024
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!
The text was updated successfully, but these errors were encountered: