fix: Allow to display events on devices - #1019
Conversation
| case is_generated(Module) of | ||
| true -> | ||
| Key = {?MODULE, source, Module}, | ||
| case persistent_term:get(Key, undefined) of |
There was a problem hiding this comment.
Why must the agents try to solve every problem in Erlang by the introduction of yet-another-adhoc persistent_term cache? 😂
Can you see any other ways to solve this? We could at minimum at least do this in hb_device's load flow where we have the existing name@ver -> module caching?
There was a problem hiding this comment.
Even before asking the agent, this solution came to mind. Other options would be ETS or adding it to Opts. ETS is 20% slow than persistant_term and modifying Opts doesn't feel like a good solution.
Agree, the persistant_term should be done on module load and not on an event call, which can be subject to concurrency.
There was a problem hiding this comment.
ets vs persistent_term point is interesting. Should we benchmark persistent_term against ets for hb_store_volatile? We use it a ton.
There was a problem hiding this comment.
I don't think persistent_term is a good candidate where too much writing is needed, because it triggers underlying code on each write. I asked an agent to run a benchmark.
On this machine, tuned ETS achieved roughly 13.6M parallel writes/s versus 387K for persistent_term.
persistent_termremained competitive for parallel reads.
a5a71d0 to
5e07202
Compare
|
Updated the PR to follow |
5e07202 to
5c47d6d
Compare
Since the restructuring of devices (#915), setting a device name in
HB_PRINTstopped working. EgHB_PRINT=dev_manifest.This PR gets the device name from HB_PRINT and finds the device name that is used inside the BEAM.
The format is
device@version. Egmanifest@1.0.