Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

debugger speed

<< < (3/6) > >>

Ceniza:
Rick: Advice from a book (not textually): "Many times having a structure that sorts its elements in every insertion (like set and map) is slower than just inserting all the elements and sorting them at the end (in a vector, deque or list)."

I haven't tried it myself, but I'll maybe do :)

Also remember there're algorithms to search an element in a sorted range.

You've been a bit paranoiac about optimizations (that's good too) so I'm just throwing some more wood to the fire :P

mandrav:

--- Quote from: rickg22 on January 04, 2006, 07:17:13 pm ---Yiannis: I'm having a Deja Vu. While doing the codecompletion optimization i noticed that i could (haven't done it yet, but will) build a tree structure using maps (inside the parserthread), to mimic the structure used inside the wxTreeCtrl. Using STL maps will make the items get sorted automatically. Finally, I'll trigger an event to update the tree (no need for sorting now) using the temporary structure.
<snip>

--- End quote ---

Here we go again :)
Rick, you 're forgetting one thing: communication with the debugger is done by piping input-output channels. This is inherently slow, when compared with directly calling code and receiving results (like codecompletion).
*And* you can't stop the debugger once you 've given it a command. You *must* wait to get all its output...

thomas:
Omg... I have to change my signature... :lol:

rickg22:
Yiannis: OK! :) I'll shut up now.
(I was just trying to help...  :oops: )

Michael:

--- Quote from: Ceniza on January 04, 2006, 07:34:56 pm ---Rick: Advice from a book (not textually): "Many times having a structure that sorts its elements in every insertion (like set and map) is slower than just inserting all the elements and sorting them at the end (in a vector, deque or list)."

--- End quote ---

IMHO, it depends on your application. Insertion is slower in a map, but faster in a vector. Find is slower in a vector, but faster in a map. All this remember me database's indexes :). Do a lot of insert into a map is time consuming and I think as Ceniza's book that in a such a case, it would be better to insert the elements at end of the container and sorting them later. Anyway, sorting algorithms are slow (especially with a lot of elements).

Personally, I find this website on STL useful :).

Michael

PS.: Optimization is a highly discussed topic. Useful? Not useful? When? IMHO an "intelligent" optimization is ok (especially if done at the end).
 

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version