Merge: new core datastructure: CircularArray
authorJean Privat <jean@pryen.org>
Thu, 3 Dec 2015 20:59:26 +0000 (15:59 -0500)
committerJean Privat <jean@pryen.org>
Thu, 3 Dec 2015 20:59:26 +0000 (15:59 -0500)
commit4a2d2f15a69c0bb3679b48610f9c83fae0a04de5
tree818b2b70e243916abe2aa87b5ede23665de3ee43
parentd71aee8dfefbc7cbf7a7e03a30acd45946674850
parent0b8e6f19118152af6c84dfcf5d73327c3d618083
Merge: new core datastructure: CircularArray

`lib/core` is extended with CircularArray for an array with efficient push/pop/shift/unshift

Some number with bench_seq. I used valgrind with n=1000

push (Ir/call)
* list: 383
* unrolled list: 188
* circular array: 135
* array: 85

pop
* unroll: 180
* list: 79
* array: 66
* circ: 47

unshift
* array: 31,755 (because memmove)
* list: 385
* unroll: 322
* circ: 127

shift
* array: 36,168 (because memmove)
* unroll: 180
* list: 79
* circ: 50

insert:
* circ: 179,811 (because manual copy item by item)
* array: 27,282
* unroll: 12,235
* list: 11,500

Pull-Request: #1875
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean-Philippe Caissy <jpcaissy@piji.ca>