qdate icon indicating copy to clipboard operation
qdate copied to clipboard

Feat/persistent term settings

Open leonardb opened this issue 1 year ago • 5 comments

Move the config/settings into persistent terms rather than use application env.

Purely for performance as application:get_env requires an ETS lookup where persistent_term is highly optimized for reads

leonardb avatar Aug 17 '23 13:08 leonardb

@choptastic Would you be ok with my moving the ets/process dictionary settings to persistent terms?

Persistent term performance should be close to process dictionary and would allow for quite a bit of simplification of how settings are handled within qdate.

leonardb avatar Aug 17 '23 13:08 leonardb

This is actually very interesting. I totally missed the introduction of the persistent_term module. Very nice!

choptastic avatar Aug 18 '23 02:08 choptastic

BTW, I see you marked this PR as a draft. I just want to check to make sure: is there anything else you'd like to add or change before I merge it in?

choptastic avatar Aug 20 '23 00:08 choptastic

@choptastic I marked as a draft since if you were ok with me converting the existing qdate_srv ets/p-dict to persistent terms I'd rework things to move all these changes into that module

leonardb avatar Aug 21 '23 14:08 leonardb

Ah yes, that makes sense. Yes, I like the plan of replacing all the ets calls with the persistent_terms. But the stuff that is actually using the process dictionary, that needs to remain as-is. The purpose for using the pdict for those functions is not performance, but for those specific settings to persist throughout that process.

choptastic avatar Aug 22 '23 21:08 choptastic