Re: FastStack - dynamically resizable data structure optimized for fast iteration

2016-08-15 Thread mora
Gc is giving back memory to the OS if there is 1 MB unused. When I increased that to 8 MB (I don't remember the exact location, maybe allocate.nim, or something like that), it helped a lot in these kind of benchmarks.

Re: FastStack - dynamically resizable data structure optimized for fast iteration

2016-08-15 Thread mbaulch
My apologies. I only looked at seq and (mistakenly) assumed all were faster. On my (rather slow) laptop, the results of the ptr benchmark are refc: Sequence 2.70ms/iter List 2.99ms/iter FastStack 2.23ms/iter Boehm: Sequence 2.43ms/iter List 3

Re: FastStack - dynamically resizable data structure optimized for fast iteration

2016-08-15 Thread Vladar
> With the Boehm GC, seq is faster With the Boehm GC **all three** are **slower** than with the default GC. Don't see a point of Boehm in such case. > Also, it's probably better to initialise FastStack to the same capacity as > the seq I'd better initialize the seq to the same capacity as Fast

Re: FastStack - dynamically resizable data structure optimized for fast iteration

2016-08-15 Thread mbaulch
With the Boehm GC, seq is faster in both of your benchmarks. The default ref-counting GC definitely has limitations. Also, it's probably better to initialise FastStack to the same capacity as the seq. 1000 vs 0 isn't really fair.

FastStack - dynamically resizable data structure optimized for fast iteration

2016-08-15 Thread Vladar
[https://github.com/Vladar4/FastStack](https://github.com/Vladar4/FastStack) FastStack is dynamically resizable data structure optimized for fast iteration over the large arrays of similar elements avoiding memory fragmentation (e.g., update and rendering cycles of a game scene). Judging by the