Currently, the field-length norm is calculated for every value. Given the operation and the toFixed usage (for mantissa = 3), there are performance implications when the list size is large (> 1000 records).
We can reduce the index generation time by caching the norm value.
Describe the solution you'd like
type Norm = (
mantissa: number
) => {
get(value: string): number // the field length norm
clear(): void // clears the internal cache
}
Description
Currently, the field-length norm is calculated for every value. Given the operation and the
toFixed
usage (for mantissa = 3), there are performance implications when the list size is large (> 1000 records).We can reduce the index generation time by caching the norm value.
Describe the solution you'd like