On Sun, Aug 24, 2008 at 1:14 PM, Christian Biere <[EMAIL PROTECTED]> wrote:
>
> Look for SORTABLE in these files:
> src/ui/gtk/gtk2/fileinfo.c
> src/ui/gtk/gtk2/search.c
>
> --
> Christian
>
I drew up some changes based on the code in src/ui/gtk/gtk2/fileinfo.c.

I ran into a few issues.

"#ifdef GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID" was not correctly
recognized by my compiler.  It didn't throw out an error, my compiler
just didn't see this as being defined.

I am using gcc-4.2.4 and gtk+-2.12.10.  In this version of gtk-2,
GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID is part of an enum structure
in gtktreesortable.h, and apparently not recognized by the
preprocessor.  I had to employ: "#ifdef __GTK_TREE_SORTABLE_H__",
which is the same #ifdef used in gtk's gtktreesortable.h file.

I also ran into some issues with the way search stats was implemented.

First, I found that search stats processing is not performed when the
search stats gui is not in focus.  This occasionally had the affect of
accumulating a large backlog of search terms when the search stats
page was finally brought back up, and gtk-gnutella was ignoring it's
other duties for several seconds.

I had to adjust the code so that the search stats are still processed
at the established interval to avoid accumulating that backlog.  I
played around with a few methods of minimizing the amount of
processing required when the search stats was not in view, but this
had the potential of building a land-mine when the view was finally
switched back to search stats, and needed to be fully processed.

Second, I found you could still set the search stats parameters so as
to accumulate so many terms that it could still run into problems with
gtk-gnutella processing the stats.  So I built in some simple load
evaluation code that would first disable sorting if more than 0.33
seconds were required to process the stats, and would disable search
stats altogether if more than 0.4 seconds were required to process
even without sorting.

It seems like the biggest usage of time is with building the gtk list.
 The hash table is very fast, but it seems like there is still the
potential for building a gtk list that is to large to process
efficiently.

One final issue that remains is this is a gtk-2.0 specific method that
is not incorporated in gtk-1.2, so this leaves me without a comparable
method for implementing these changes in the gtk-1.2 section.

I hope you find these changes are not too extensive.  I tried to
change as little as possible, but I also understand that you would
want to be very careful about re-enabling a section of code that could
hurt the primary function of gtk-gnutella.

I am attaching a patch containing my current changes for enabling
search stats in gtk-gnutella.  If you decide not to employ the patch,
I hope you at least find the exercise of revisiting this issue of some
value.

Attachment: search_stats_patch_v0.2
Description: Binary data

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gtk-gnutella-devel mailing list
gtk-gnutella-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel

Reply via email to