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

Switch to reading dictionaries during the fastly_dictionary_open call #379

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

elliottt
Copy link
Contributor

Read dictionaries during the open host call instead of once for each get call. This improves viceroy performance for large dictionaries, and more closely matches the semantics of the production environment, as changes made while the dictionary is open won't be reflected in subsequent get calls.

Additionally, remove the DictionaryName newtype, as it wasn't offering anything over using a String directly.

co-authored-by: Jamey Sharp [email protected]

@elliottt elliottt force-pushed the trevor/read-dictionary-during-open branch from ba68e2b to 1942418 Compare June 10, 2024 20:08
Read dictionaries during the `open` host call instead of once for each
`get` call. This improves viceroy performance for large dictionaries,
and more closely matches the semantics of the production environment, as
changes made while the dictionary is open won't be reflected in
subsequent `get` calls.

Additionally, remove the `DictionaryName` newtype, as it wasn't offering
anything over using a `String` directly.

co-authored-by: Jamey Sharp <[email protected]>
@elliottt elliottt force-pushed the trevor/read-dictionary-during-open branch from 1942418 to e65851a Compare June 10, 2024 20:11
Copy link
Contributor

@acfoltzer acfoltzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement on the reduced parsing!

I have mixed feelings about removing DictionaryName; I suspect it was set up as a newtype in order to potentially encode the platform restrictions on dictionary names. But if it's not being used for that right now, we might as well get rid of it... there's already some deferred work hiding here to differentiate between dictionaries and config stores, and enforcing name restrictions would probably be better done at that point.

@elliottt elliottt merged commit 2925fe0 into main Jun 11, 2024
7 checks passed
@elliottt elliottt deleted the trevor/read-dictionary-during-open branch June 11, 2024 23:06
GeeWee pushed a commit to GeeWee/Viceroy that referenced this pull request Jul 25, 2024
…ll (fastly#379)

Read dictionaries during the `open` host call instead of once for each
`get` call. This improves viceroy performance for large dictionaries,
and more closely matches the semantics of the production environment, as
changes made while the dictionary is open won't be reflected in
subsequent `get` calls.

Additionally, remove the `DictionaryName` newtype, as it wasn't offering
anything over using a `String` directly.

Co-authored-by: Jamey Sharp <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants