[Rpm-maint] [PATCH] Improve macro table performance

2013-01-29 Thread Alexey Tourbin
On Mon, Jan 28, 2013 at 4:10 PM, Florian Festi ffe...@redhat.com wrote: On 01/28/2013 04:05 AM, Alexey Tourbin wrote: In the existing implementation, when a new macro is added, the whole table has to be sorted again. Hence the cost of adding n macros is worse than O(n^2), due to arithmetic

Re: [Rpm-maint] [PATCH] Improve macro table performance

2013-01-28 Thread Florian Festi
On 01/28/2013 04:05 AM, Alexey Tourbin wrote: In the existing implementation, when a new macro is added, the whole table has to be sorted again. Hence the cost of adding n macros is worse than O(n^2), due to arithmetic progression. This change drops all qsort(3) stuff altogether, by

[Rpm-maint] [PATCH] Improve macro table performance

2013-01-27 Thread Alexey Tourbin
In the existing implementation, when a new macro is added, the whole table has to be sorted again. Hence the cost of adding n macros is worse than O(n^2), due to arithmetic progression. This change drops all qsort(3) stuff altogether, by carefully preserving table in sorted order. In findEntry