May 2019
Intermediate to advanced
698 pages
17h 21m
English
In order to add a location, there are two important steps:
Further operations, such as doing a sorted insert, will improve performance too, but they can be omitted by using a tree instead of a list within each bucket.
The location cache implementation uses a simple modulo operation between the hash and the length of the array to choose a bucket, which means that on top of regular hash collisions, choosing the size of the internal storage has a major influence on the performance as well. Choose a size too small and the buckets will overlap, regardless of the hash function!
In Rust code, the first part is done in the first line using the provided boxed hashcode function to create a hash. What ...
Read now
Unlock full access