[Year 12 SofDev] A matter of style - GUI data structures vs primitives

Steven Bird sb at csse.unimelb.edu.au
Mon Nov 29 10:54:18 EST 2010


On 29 November 2010 10:38, Mark KELLY <kel at mckinnonsc.vic.edu.au> wrote:
> Most programming languages now offer GUI data structures like listboxes,
> grids etc.
> I'm interested to know how many people use them as their primary data
> structures ...

Are you talking about how you use the graphical interface of the IDE
that comes with your favourite programming language, or are you
talking about the API to the graphics library that comes with the
language?

> What sort of performance penalty does the use of the GUI data structure
> impose? Do the GUI structure's capabilities (e.g. auto-sorting lists)
> outweigh the penalty?
> How efficient is the GUI's inbuilt sorting algorithm compared to a good
> do-it-yourself sorting algorithm?

A built-in sorting function will usually be close to the optimal O(n
log n) performance.   If you implement your own (by why would you
these days?) then it might be as bad as O(n^2).  However, the
difference between these is likely to be insignificant for the size of
data you're talking about.  The dominant factor might be that the
built-in function was compiled, while yours might be interpreted (if
you're using VB, PHP, Python, etc).

-Steven Bird
http://www.csse.unimelb.edu.au/~sb/


More information about the sofdev mailing list