I've been tracing a hot path in our app, and found a surprisingly expensive call to Cldr.Number.to_string. A call to this is dominated by Cldr.Number.Format.Options:validate_options/3, specifically, a call to [Backend].Cldr.Number:default_options/0 calling Cldr:get_locale/1 in turn. I've attached a flame graph you can open in https://www.speedscope.app/
1774277542281657-eflambe-output.bggg.zip
I think this could be solved by lazily evaluating the default options on a per-key basis. Do you have any particular preference about how to approach this?
I've been tracing a hot path in our app, and found a surprisingly expensive call to
Cldr.Number.to_string. A call to this is dominated byCldr.Number.Format.Options:validate_options/3, specifically, a call to[Backend].Cldr.Number:default_options/0callingCldr:get_locale/1in turn. I've attached a flame graph you can open in https://www.speedscope.app/1774277542281657-eflambe-output.bggg.zip
I think this could be solved by lazily evaluating the default options on a per-key basis. Do you have any particular preference about how to approach this?