Speed up lookups using a cache map #12
Labels
No labels
type
dependency-dashboard
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: yolokube/country-geo-locations#12
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, the specified IP address is converted to the integer
ipnum
and then the net address is calculated from "/24" because there are no public networks smaller than /24. If there is no match, the integer of the net addressipnetnum
is reduced until there is a match in the database or until 0 is reached. For IP addresses from the same network, the reduction time can be saved by caching.The cache seems to work and reduces the lookup / calculation time.
with cache:
without cache: