freifunk-gluon / l3roamd

BSD 2-Clause "Simplified" License
12 stars 6 forks source link

vector implementation - allow to insert in a sorted way #49

Closed christf closed 1 year ago

christf commented 5 years ago

that means we could access elements of the vector faster.

penguineer commented 5 years ago

This would be a heap instead of a vector. Maybe we are using the wrong structure?

penguineer commented 5 years ago

https://github.com/freifunk-gluon/l3roamd/blob/master/src/vector.c#L50

This function could be much more efficient if the allocated size is strictly controlled and we can assume that alloc sizes are always a power of 2.

penguineer commented 5 years ago

https://github.com/freifunk-gluon/l3roamd/blob/master/src/vector.c#L74

I propose adding an append function - no need to copy unused memory.

christf commented 5 years ago

well, the common use case will be a few (dozen?) local clients. There was no performance analysis yet however it is doubtful we will see bottlenecks in the near future. Let's see that we have a problem and then we understand it and implement improvements.