mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Sorting speed-up: Cache the bool value of Transaction's is_closing property.
This value is queried on each comparison of split or txn sort function, which means it is called quite a lot. Avoiding the KVP lookup of this property gains a lot in terms of CPU cycles.
This commit is contained in:
@@ -119,6 +119,11 @@ struct transaction_s
|
||||
*/
|
||||
char * readonly_reason;
|
||||
gboolean reason_cache_valid;
|
||||
|
||||
/* Cached bool value to indicate whether this is a closing txn. This is
|
||||
* cached from the KVP value because it is queried a lot. Tri-state value: -1
|
||||
* = uninitialized; 0 = FALSE, 1 = TRUE. */
|
||||
gint isClosingTxn_cached;
|
||||
};
|
||||
|
||||
struct _TransactionClass
|
||||
|
||||
Reference in New Issue
Block a user