contexts:
  - name: "1.1.0.dev"
    gems:
      enumerable-statistics: "1.1.0.dev"
    require: false
    prelude: |-
      require 'enumerable/statistics'
  - name: "HEAD"
    prelude: |-
      require 'bundler/setup'
      require 'enumerable/statistics'
prelude: |-
  n = 1000
  chars = ('a'..'m').to_a
  hash = Array.new(n) { chars.sample }.each_with_index.to_h
benchmark:
  inject: |-
    hash.inject(Hash.new(0)) { |h, (k, v)| h[v] += 1; h }
  unsort_keepna: |-
    hash.value_counts(sort: false, dropna: false)
  unsort_dropna: |-
    hash.value_counts(sort: false, dropna: true)
  sort_keepna: |-
    hash.value_counts(sort: true, dropna: false)
  sort_dropna: |-
    hash.value_counts(sort: true, dropna: true)
  norm_unsort_keepna: |-
    hash.value_counts(normalize: true, sort: false, dropna: false)
  norm_unsort_dropna: |-
    hash.value_counts(normalize: true, sort: false, dropna: true)
  norm_sort_keepna: |-
    hash.value_counts(normalize: true, sort: true, dropna: false)
  norm_sort_dropna: |-
    hash.value_counts(normalize: true, sort: true, dropna: true)
  sort_asc_keepna: |-
    hash.value_counts(sort: true, ascending: true, dropna: false)
  sort_asc_dropna: |-
    hash.value_counts(sort: true, ascending: true, dropna: true)
  norm_sort_asc_keepna: |-
    hash.value_counts(normalize: true, sort: true, ascending: true, dropna: false)
  norm_sort_asc_dropna: |-
    hash.value_counts(normalize: true, sort: true, ascending: true, dropna: true)
