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

Optimise boot speed + remove the need for traverse #282

Merged
merged 6 commits into from
Oct 13, 2021

Conversation

sjoerddal-pti
Copy link
Contributor

We've got a fairly sizable set of protos and we were noticing some really bad startup performance on our APIs. I did some profiling and found that Mali was hanging on traverse() for a really long time while gathering service definitions.

This PR switches traverse for a lighter implementation that still scans the full object passed to getServiceDefinitions and avoids circular object refs / checking nodes twice all while being a whole lot faster than the current method.

These changes brought our API startup time down from 45 seconds to a few milliseconds.

@anonrig anonrig self-assigned this Oct 13, 2021
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 97.962% when pulling 58f9679 on sjoerddal-pti:optimise-boot-speed into d6707c1 on malijs:master.

@malijs malijs deleted a comment from coveralls Oct 13, 2021
@anonrig
Copy link
Member

anonrig commented Oct 13, 2021

This looks amazing. Thank you for the contribution. Changing the API boot time from 45 seconds to a few milliseconds is really awesome. It would be great if you can add your company to the following issue: #59

@anonrig anonrig merged commit 3a95b51 into malijs:master Oct 13, 2021
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.

3 participants