-
-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor potentially heavy cryptographic hashing
...and add 2 layers of hashing: one based on Java-hash + mod and the other based on FNV1-32 (up for discussion). The result of the first layer is just stored in a BitSet. This only allows us to tell if there's a dupe. For the first layer collisions are expected. The result of the seconds layer is a map between the hash and the data ID. The first layer, however, allows to delay the need to create a "real" hash. In addition some "filtering" was added to only perform all this hashing, if the tile's size is below a certain threshold because dupes onyl occur on simple/small tiles like ocean tiles. As part of this, the actual encoding was extracted, as well. Note: The improvement is barely noticable but it's probably the right thing to do.
- Loading branch information
Showing
3 changed files
with
151 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.