Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache field-length norm to reduce index generation time #407

Closed
krisk opened this issue Apr 28, 2020 · 0 comments
Closed

Cache field-length norm to reduce index generation time #407

krisk opened this issue Apr 28, 2020 · 0 comments
Assignees
Labels
Milestone

Comments

@krisk
Copy link
Owner

krisk commented Apr 28, 2020

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

type Norm = (
  mantissa: number
) => {
  get(value: string): number // the field length norm
  clear(): void // clears the internal cache
}
@krisk krisk added the feature label Apr 28, 2020
@krisk krisk added this to the v5.3.0 milestone Apr 28, 2020
@krisk krisk self-assigned this Apr 28, 2020
krisk added a commit that referenced this issue Apr 28, 2020
@krisk krisk closed this as completed Apr 28, 2020
@krisk krisk modified the milestones: v5.3.0, v6.0.0 May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant