-
Notifications
You must be signed in to change notification settings - Fork 82
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
gid and tests #190
base: master
Are you sure you want to change the base?
gid and tests #190
Conversation
Out of curiosity did you profile/time this at any point? |
@joereynolds what do you think? I used max_gid
with 10'000'000 calls
with 1'000'000 calls
with 100'000 calls
with 10'000 calls
|
b06264c
to
1873265
Compare
So, I wanted to walk you through some improvements I made to the
decode_gid
function. One of the main things I did was implement a global cache. Essentially, a dictionary calledflag_cache
that stores the mapping between raw GIDs and their correspondingTileFlags
objects.This way, if we encounter the same GID again, we can just grab the cached result instead of recalculating it.
Everything else are additional tests.
Do we need to implement a
ValueError
ifraw_gid < 0
?