Hi,

I was bothered that when you select lots of files to
download (e.g. a couple thousand), gtk-gnutella locks
up for minutes while it adds the files to the download
queue.  I interrupted it while it was locked up and looked
at what it was doing.  Here is a stack trace (I deleted the
function arguments):

(gdb) bt
#0  0x42050f93 in vfprintf () from /lib/i686/libc.so.6
#1  0x42072f84 in vsnprintf () from /lib/i686/libc.so.6
#2  0x0809a6c7 in gm_snprintf() at glib-missing.c:175
#3  0x080aee9b in guid_hex_str () at misc.c:378
#4  0x080d12bf in download_store () at downloads.c:5603
#5  0x080ccc4c in create_download () at downloads.c:2608
#6  0x080cd1ad in download_new () at downloads.c:2933
#7  0x080a5367 in download_selection_of_clist () at search_gui.c:1130
#8  0x080a5478 in search_gui_download_files () at search_gui.c:1182

The bottle neck seems to be that download_store is called 
for every file.  As an experiment, I removed the call to 
download_store from create_download, made download_store an
external function, and called it at the end of the for loop
in download_selection_of_clist().  I was able to add a
couple thousand files to the download queue in just a few
seconds.

I know there may be problems with this solution (e.g.
download_new is called by download_selected_file which is
used in a gtk callback).  But, maybe separate functions
could be created -- one for batch processing where the
caller is responsible for calling download_store, and one
for callbacks where the function would call download_stored.

Paul


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Gtk-gnutella-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel

Reply via email to