Efficiency of big return functions?

Oliver Korpilla oliver.korpilla@REDACTED
Sat Aug 29 23:38:12 CEST 2020


Hello, Jesper.

I ended up converting the data structure to code on the fly, which
yielded a nice API interface with convenience functions and secondary
key lookup. I replace a dummy version of the accessor API with the
actual API during the startup of my application when configuration data
has been read and preprocessed.

Should I require update functionality in the future (even then it would
definitely be infrequent) I could indeed replace the generated code with
calls into persistent_term but keep the API, I guess.

If I understand you right, my generated code has probably no performance
advantage over persistent_term? Shame... It was fun to write, though...

Thanks,

Olivwe

On 29.08.2020 22:46, Jesper Louis Andersen wrote:
> On Thu, Aug 27, 2020 at 11:51 AM Oliver Korpilla
> <oliver.korpilla@REDACTED <mailto:oliver.korpilla@REDACTED>> wrote:
>
>     Hello,
>
>     I have some data that's between 100K and 1M in size, depending if
>     I use
>     the whole data set or just a part. Access is read-only.
>
>
> Sounds like a job for the module persistent_term to me. That should
> give you very fast read-only access. It kind-of uses the same literal
> space as other posts suggest, but does it a bit more directly.
>

--
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus



More information about the erlang-questions mailing list