← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] wxWidgets 2.8 under Graphics Abstraction Layer Lib (GAL)

 

On 01/03/2011 05:26 PM, "Torsten Hüter" wrote:
> Hi Dick,
>  
>> Is this still on your to do list?
> Yes, of course, I just had not the time that I thought I would have and the example grows also bigger than expected ..
>
>> Some minor suggestions for improvements:
>>
>> 1)))))))))))))))))
>>
>> Also, std::list should be changed to std::deque wherever it is being used.
>> std::list is too slow for several reasons:
>> a separate heap allocation must happen just to store the separate linked
>> list backbone noes, per content node.
>> That linkedlist node must store a pointer to real content node, slowing
>> down
>> again the traversal, due to the dereferencing of the linked-list node
>> pointer.
>> Heap allocation is by far the slowest issue.  You have twice as many in a
>> std::list,  I will use std::deque.  Its ten minutes to change it.
> Yes, I agree - this was just an initial choice - I've changed some types already to std::vector but the std::deque is also a good idea.
>
>> 2)))))))))))))))))
>>
>> I am not a fan of BOOST_FOREACH.  Some in this team are, I am not. It does
>> not provide enough value for the costs:
>>
>> 1) obscurity about what code it is actually generating.
>>
>> 2) longer compile times.
>>
>> Suggest simply writing the 3 statements that the macro is replacing, so we
>> see what the compiler sees.
> The Eclipse CDT formatter has also a lot trouble with it. Good suggestion.
>
>> Again, I will need write access to this repo, if I am going to use it.  I
>> was thinking of using it for a simple Sweet viewer.  Of course I can
>> always
>> make my own copy of the repo and make it public, thanks to your generosity
>> of contributing this code under the GPL.  If you are too busy, let me know
>> and I will do these items myself.
> Shouldn't take much time, I've changed only the directory structure a lot - I'll upload it in the next days.
>
> Bye ..
> Torsten

You da man!

std::vector is better than std::list.  std::deque and std::vector are both
OK.  The only difficulty with std::vector is if you hundreds of thousands of
points in a polyline, in which case the backbone array needs to be very
large.  std::deque uses a segmented backbone, and could be slower than
std::vector for smaller numbers of points.  So std::vector is fine if you
are already there.

Thank you.

Dick







Follow ups

References