@@ -258,12 +258,14 @@ raw counts.
258
258
- `:radixsort`: if `radixsort_safe(eltype(x)) == true` then use the
259
259
[radix sort](https://en.wikipedia.org/wiki/Radix_sort)
260
260
algorithm to sort the input vector which will generally lead to
261
- shorter running time. However the radix sort algorithm creates a
262
- copy of the input vector and hence uses more RAM. Choose `:dict`
263
- if the amount of available RAM is a limitation.
261
+ shorter running time for large `x` with many duplicates. However
262
+ the radix sort algorithm creates a copy of the input vector and
263
+ hence uses more RAM. Choose `:dict` if the amount of available
264
+ RAM is a limitation.
264
265
265
266
- `:dict`: use `Dict`-based method which is generally slower but uses less
266
- RAM and is safe for any data type.
267
+ RAM, is safe for any data type, is faster for small arrays, and
268
+ is faster when there are not many duplicates.
267
269
"""
268
270
addcounts! (cm:: Dict , x; alg = :auto ) = _addcounts! (eltype (x), cm, x, alg = alg)
269
271
@@ -430,12 +432,14 @@ raw counts.
430
432
- `:radixsort`: if `radixsort_safe(eltype(x)) == true` then use the
431
433
[radix sort](https://en.wikipedia.org/wiki/Radix_sort)
432
434
algorithm to sort the input vector which will generally lead to
433
- shorter running time. However the radix sort algorithm creates a
434
- copy of the input vector and hence uses more RAM. Choose `:dict`
435
- if the amount of available RAM is a limitation.
435
+ shorter running time for large `x` with many duplicates. However
436
+ the radix sort algorithm creates a copy of the input vector and
437
+ hence uses more RAM. Choose `:dict` if the amount of available
438
+ RAM is a limitation.
436
439
437
440
- `:dict`: use `Dict`-based method which is generally slower but uses less
438
- RAM and is safe for any data type.
441
+ RAM, is safe for any data type, is faster for small arrays, and
442
+ is faster when there are not many duplicates.
439
443
"""
440
444
countmap (x; alg = :auto ) = addcounts! (Dict {eltype(x),Int} (), x; alg = alg)
441
445
countmap (x:: AbstractArray{T} , wv:: AbstractVector{W} ) where {T,W<: Real } = addcounts! (Dict {T,W} (), x, wv)
0 commit comments