-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Improve OTB loader iteration #4795
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rani, here are some considerations I noted while reviewing;
- do we have something like a debug assert? Is it the same thing?
src/podium.cpp
Outdated
} | ||
|
||
uint8_t flags = 0; | ||
propStream.read<uint8_t>(flags); | ||
uint8_t flags = OTB::read<uint8_t>(first, last); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use auto
in most cases here.
Just learned about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more points to consider; I really liked the new approach!
Unfortunately, I won't be able to test these changes (VS is having some issues...)
I'm still working on it to make a single pass loader, it should save a significant amount of time |
aea5000
to
8167918
Compare
Pull Request Prelude
Changes Proposed
Improves file loader performance by having less indirection and skipping checks aggressively. Loading the map is at least 20% faster (4s -> 3.2s) on my machine using EPuncker/orts2 map.
When running a release build, most of the sanity checks will be skipped (e.g. checking if the file does not underflow, if the nodes have expected types) since we expect map editors to generate correct map files. The map only needs to be loaded once with a debug build if one wants to make sure it works, so there is no need to check again on every start.