forked from OCamlPro/alt-ergo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: Improve performance of literal de-duplication
This patch improves the different code paths that are used to ensure literal uniqueness. There are a couple of performance bugs here that are fixed by this patch: - In Rel_utils, we use a set of Xliteral *views*, which are converted to actual Xliterals in the comparison function. This means that we hash the literal views repeatedly (each time a comparison is performed). - Everywhere, we use sets of literals as temporary caches for uniqueness, where we could use hash maps (with better access times) instead. - In Adt_rel, we de-deduplicate input literals, but this is (almost) already done in the Ccx module. Almost, because the Ccx module allows multiple literals as long as they originally come from different expressions in the input problem -- which should occur rarely enough that we don't need the double deduplication. On a development branch and a specific problem that was creating a lot of literals, the first change was a 3x speedup (from 36s to 12s), and the two second changes combined were an additional 25% speedup (from 12s to 9s). On our internal dataset, the full patch is a speedup of about 3-4%.
- Loading branch information
1 parent
4bc9573
commit 83d1176
Showing
3 changed files
with
44 additions
and
51 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
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