# Finding low frequency numbers in a large collection

**URL:** https://discourse.julialang.org/t/finding-low-frequency-numbers-in-a-large-collection/93556
**Category:** Performance
**Created:** [January 26, 2023, 6:50am UTC](https://discourse.julialang.org/t/finding-low-frequency-numbers-in-a-large-collection/93556 "2023-01-26T06:50:08Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![CodeGodz](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@CodeGodz](https://discourse.julialang.org/u/CodeGodz)
#### Post date: [January 26, 2023, 6:44pm UTC](https://discourse.julialang.org/t/finding-low-frequency-numbers-in-a-large-collection/93556/9 "2023-01-26T18:44:21Z")

</div>

Hey!

I can know the numbers beforehand (just not their frequency). Ideally I would find a solution that can handle up to the max of `UInt64`. For a test set, I have the distribution of numbers that looks evenly sampled from the range:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/a/3/a3ab068bbd1a32af85c1ec67402ce0743e7875fb.png)

The counts for the numbers are heavily skewed, in fact, 75% of the numbers are `<=100`. This is because these numbers originate from DNA data and hence are not random:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/2/e2a6951100e24abd99ce830c66f49484f20fe586.png)  
_(The x-scale is log10)_

* * *

I’m not sure if I get your second proposal. Could you elaborate as it sounds nice 🙂

> if you were to sort your list before counting  
> …as you can start each thread from a different part in the array

I do not really have a list beforehand as I have to read the numbers from a file (or actually parse them as it is text format with some mess in between). I could pass bytes to different threads, parse the numbers, and then maybe do what you propose?

---

_[View the full topic](https://discourse.julialang.org/t/finding-low-frequency-numbers-in-a-large-collection/93556)._
