Re: CList glitch (some kind o off-topic response)



> Hi!
>
> I'm developing a small application (it's a dictionary for translating
> words from one language to another) and discovered a problem with
> CList widget. It's *very* slow on big list of words. When I fill it
> with some thousand words, it is fast (it takes only a fraction of
> a second to fill), but when I fill it with contents of the entire
> dictionary (50 thousand words approx.) it takes some minutes to fill.
> Seems there is a design flaw somewhere in memory management system,
> isn't it? The problem was discovered with gtk 1.2.3 and exists in 1.2.6.
> Can something be done about that? I want user to be able to view all
> dictionary at once, and now seems it can't be done.
>
> Leon.
>

    Hi Leon,

    I don't think it is a very good idea to use a list widgetto display more
    than a few hundreds of line. There should be some reasons for that :

        * user may have to scroll during four hours to find the thing he
wants
        * if the entry are sorted, finding stuff is easier but the insertion
of
        items is very slow (something like O(n^2) if I remember the last
        discussion about GList sorting here). That's probably why your
        application is so slow when you use 50000 words (up to
        2 500 000 000 operations ! whow !)

    A better solution should be to use some kind of pre-sorting (A, B, C,
...
    should do it well, since it will reduce most of your list to handle
something
    like 2000/3000 words - that's really a big list :)

    Hope it helps,

    Emmanuel




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]