Re: Why no gtkmm equivalent for gtk_list_store_set?



First off I've been thinking on how to do it best with gtkmm for a while too because the increase is -indeed- tremendous and by no means negligable. The difference _IS_ tremendous by all standards. Even if the figures presented here should be somewhat off because of other workload on the box or whatever, it is extreme.

The problem i guess is that vararg functions are sort of a no-no-uhmm-yeah-only-if-you-really-have-to with C++; everything needs to be statically typed and predefined to guarantee comile time safety.


While no one will hear a complaint about _this_ from me, the ListStore/TreeStore situations need to be fixed; there needs to be an API that allows atomic setting of entire rows.

To preempt the obvious "yeah then why don't you come up with something" message: I would, in case I get support from the gtkmm devs. I'm not a C++ coder par excellence, nor am i entirely through with gtkmm myself (mostly, i guess but not entirely), and i don't think i can come up with something if all i'm going to hear will be "yeah, good idea, tell us when you're done".

It should be clear to see that this is by no means a personal request by Jef or me, and not even one that should become concern of the entire gtkmm team because we brough it up, but simply because it needs to be done this or the other way anyway; you can't neglect a speed increase of 7500%.

What's the gtkmm development team's take on this? Please don't feel prodded nor pushed into a speechless situation, but take this as a serious, real, and existing issue.

--Milosz

On 7/26/07, Jef Driesen <jefdriesen hotmail com> wrote:
Is there a reason why there is no equivalent gtkmm function for
gtk_list_store_set? Because changing multiple columns at once is really
MUCH faster than changing one column at a time.

In my application I noticed a speed difference of 75 times (1500ms vs
20ms)! The treeview model has 11 columns and around 850 rows, and I'm
using this piece of code to fill the model (from an sqlite database):

clock_t start = clock ();

while (cmd.step()) {
    // USING GTKMM FUNCTIONS
    Gtk::TreeModel::Row row = *(store->append());
    row[m_columns.number] = cmd.column_int(0);
    row[m_columns.datetime] = cmd.column_text(1);
    // other columns here

    // USING GTK+ FUNCTIONS
    GtkTreeIter iter;
    gtk_list_store_append(GTK_LIST_STORE(store->gobj()),&iter);
    gtk_list_store_set(GTK_LIST_STORE(store->gobj()),&iter,
       m_columns.m_number.index(), cmd.column_int (0),
       m_columns.m_datetime.index(), cmd.column_text(1),
       // other columns here
       -1
    );
}

clock_t finish = clock ();
double duration = (double)(finish - start) / CLOCKS_PER_SEC);
printf("Time: %f ms\n", 1000.0 * duration);

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list



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