> I am brand new to Nim, and was inspired by the Advent of Nim post

Glad to have you with us :)

> In my testing, `initIntSet()` turned out to be a lot faster than initializing 
> with `initSet[int](<big number, power of 2>)`

You're not using high enough number ;) Try it with something like `2^17`. There 
should be a difference between the two (with `intSet` being faster), but just a 
couple of miliseconds between them (when you compile with `-d:release`).

Now, the more interesting question is _why?_ , and the simple answer (allow me 
this, I'm waking up around 5:30 for AoC :)) is because the different ways these 
two sets are implemented (if you're interested, here are the source codes: 
[hash 
sets](https://github.com/nim-lang/Nim/blob/master/lib/pure/collections/sets.nim),
 [int 
sets](https://github.com/nim-lang/Nim/blob/master/lib/pure/collections/intsets.nim)).
 If somebody else would like to go into more details, be my guest.

Reply via email to