When creating lists of database objects, use g_list_prepend() rather than g_list_append(). There may be cases where the list order is significant and thus needs to be reversed, but that is not true in these cases. This provides a large improvement in database loading performance.

Analysis and basis patch supplied by Donald Allen.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18724 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Phil Longstaff
2010-02-24 20:11:22 +00:00
parent 61937bc3dd
commit cd0b4fe145
3 changed files with 4 additions and 4 deletions

View File

@@ -245,7 +245,7 @@ load_all_sxes( GncSqlBackend* be )
sx = load_single_sx( be, row );
if( sx != NULL ) {
gnc_sxes_add_sx( sxes, sx );
list = g_list_append( list, sx );
list = g_list_prepend( list, sx );
}
row = gnc_sql_result_get_next_row( result );
}