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

Use hash lookup to find global values #194

Merged
merged 12 commits into from
Jul 11, 2020
Merged

Use hash lookup to find global values #194

merged 12 commits into from
Jul 11, 2020

Conversation

masak
Copy link
Owner

@masak masak commented Jul 9, 2020

This speeds up the test suite by about 70%.

Carl Masak added 12 commits July 11, 2020 23:03
As a first step towards creating a global object that can do hash-based
lookups.
This is a precursor to building the linked list at the same time as the
hash. Doing things in small refactor steps is very nice, besides being
almost essential.
This slows down the test suite considerably; I think because the
order the globals are accessed is now predictable, and (maybe more
importantly) many of the commonly-called globals end up fairly
deep in the list.

Of course, with some searching we could find a better order for the
globals, to make the test suite run faster. But by the end of this
branch, it won't matter either way, because we'll be doing hash-based
lookups.
This is a precursor to just accessing the pairs directly by hash.
We'll probably go back to storing a "globals object" quite soon,
because the globals shouldn't be a singleton like they are now.
But as long as they are, this is the simpler form.
@masak masak force-pushed the masak/fastify-globals branch from 0035277 to b208ce0 Compare July 11, 2020 15:04
@masak masak merged commit 87fe36e into master Jul 11, 2020
@masak masak deleted the masak/fastify-globals branch July 11, 2020 15:32
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.

1 participant