mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -331,7 +331,7 @@ load_all_budgets( GncSqlBackend* be )
|
||||
while( row != NULL ) {
|
||||
b = load_single_budget( be, row );
|
||||
if( b != NULL ) {
|
||||
list = g_list_append( list, b );
|
||||
list = g_list_prepend( list, b );
|
||||
}
|
||||
row = gnc_sql_result_get_next_row( result );
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ load_splits_for_tx_list( GncSqlBackend* be, GList* list )
|
||||
Split* s;
|
||||
s = load_single_split( be, row );
|
||||
if( s != NULL ) {
|
||||
split_list = g_list_append( split_list, s );
|
||||
split_list = g_list_prepend( split_list, s );
|
||||
}
|
||||
row = gnc_sql_result_get_next_row( result );
|
||||
}
|
||||
@@ -382,7 +382,7 @@ query_transactions( GncSqlBackend* be, GncSqlStatement* stmt )
|
||||
while( row != NULL ) {
|
||||
tx = load_single_tx( be, row );
|
||||
if( tx != NULL ) {
|
||||
tx_list = g_list_append( tx_list, tx );
|
||||
tx_list = g_list_prepend( tx_list, tx );
|
||||
}
|
||||
row = gnc_sql_result_get_next_row( result );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user