Re: Speedup insert into treestore



Hi Florian,

As a workaround, keep your own perl reference to the value returned  
from Gtk2::TreeStore::new, to prevent Glib::Object::DESTROY from  
releasing that C reference.

Yep, that works very good. That's the good news of all your hard work.
The downside is: I gain only about 2/10 of a second (about 5 %)...
I'll have to play a bit more with my code to see where all those
processor cycles get used up.

Now that we have tracked down some of the "Perl side" of performance,
let me give some advices:

  1. the GtkTreeView widget is *still* not very optimized for speed;
this is bound to change with the next Gtk release, with the awesome
profiling work done by the Gtk people, especially Federico Mena
Quintero;

  2. profiling could be interesting - I don't know if there are native
Perl profiling tools (never really had to profile things in Perl;
usually, I rewrite speed critical sections in C and profile those), but
it there are, then you should really use them; and if not, then even a
poor man's profiling(tm) using printf, Benchmark and Benchmark::Timer or
Test::Benchmark is the right way to go;

  3. you should really try the 'fixed-height-mode' property for
Gtk2::TreeView. ;-)

Ciao,
 Emmanuele.

-- 
Emmanuele Bassi - <ebassi gmail com>
Log: http://log.emmanuelebassi.net





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