Skip to content

Commit

Permalink
fix intersection benchmarks for paguro, and show correct images for s…
Browse files Browse the repository at this point in the history
…et union ops
  • Loading branch information
ztellman committed Oct 9, 2018
1 parent b8a4003 commit 05d6dcb
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 11 deletions.
Binary file modified benchmarks/images/map_construct.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified benchmarks/images/map_difference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified benchmarks/images/map_equals.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified benchmarks/images/map_intersection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified benchmarks/images/map_iterate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified benchmarks/images/map_lookup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified benchmarks/images/map_union.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified benchmarks/images/set_difference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified benchmarks/images/set_intersection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified benchmarks/images/set_union.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 4 additions & 6 deletions doc/comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,11 @@ This compares set operations on maps whose keys half-overlap. Using its canonic

## hash sets

Since every hash set shared an implementation with their respective hash map, they demonstrate the same performance as shown above.
Since every hash set shares an implementation with their respective hash map, they have similar performance characteristics to those shown above. Some libraries, however, provide special paths for set operations on hash sets:

Scala, however, has clearly optimized for set operations on their hash sets specifically, as they are comparable to Bifurcan across the board:

![](../benchmarks/images/sorted_map_union.png)
![](../benchmarks/images/sorted_map_intersection.png)
![](../benchmarks/images/sorted_map_difference.png)
![](../benchmarks/images/set_union.png)
![](../benchmarks/images/set_intersection.png)
![](../benchmarks/images/set_difference.png)

## sorted maps

Expand Down
10 changes: 5 additions & 5 deletions test/bifurcan/benchmark_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@

(defn intersect-paguro-sorted-map [^PersistentTreeMap a ^PersistentTreeMap b]
(let-mutable [a a]
(doit [k (.keySet b)]
(when-not (.containsKey ^PersistentTreeMap a k)
(doit [k (.keySet ^PersistentTreeMap a)]
(when-not (.containsKey ^PersistentTreeMap b k)
(set! a (.without ^PersistentTreeMap a k))))
a))

Expand Down Expand Up @@ -414,8 +414,8 @@

(defn intersect-paguro-set [^PersistentHashSet a ^PersistentHashSet b]
(let-mutable [a (.mutable a)]
(doit [k b]
(when-not (.contains ^PersistentHashSet$MutableHashSet a k)
(doit [k a]
(when-not (.contains b k)
(set! a (.without ^PersistentHashSet$MutableHashSet a k))))
a))

Expand Down Expand Up @@ -477,7 +477,7 @@

(defn insert-string [^String a ^String b ^long idx]
(let [idx (.offsetByCodePoints a 0 idx)]
a (.concat
(.concat
(.concat
(.substring a 0 idx)
b)
Expand Down

0 comments on commit 05d6dcb

Please sign in to comment.