Just a idea for a possible optimization.
Instead of this map/filter/reduce some code could be generated at compiletime with data from the JSON file to let the BEAM Runtime do that lookup via pattern matching:
https://github.com/dantame/sentient/blob/master/lib/sentient.ex#L14-L16
A simple example from a library i did:
https://github.com/h4cc/slugger/blob/master/lib/slugger.ex#L79-L84
Just a idea for a possible optimization.
Instead of this map/filter/reduce some code could be generated at compiletime with data from the JSON file to let the BEAM Runtime do that lookup via pattern matching:
https://github.com/dantame/sentient/blob/master/lib/sentient.ex#L14-L16
A simple example from a library i did:
https://github.com/h4cc/slugger/blob/master/lib/slugger.ex#L79-L84