gnucash stable: [sixtp-dom-parsers.cpp] Remove unnecessary commodity allocation during XML load

Christopher Lam clam at code.gnucash.org
Sun Dec 7 09:41:16 EST 2025


Updated	 via  https://github.com/Gnucash/gnucash/commit/2f7e51cf (commit)
	from  https://github.com/Gnucash/gnucash/commit/b397a344 (commit)



commit 2f7e51cf2a8258180ed382801ace7ff5705d7a79
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sun Dec 7 14:11:47 2025 +0800

    [sixtp-dom-parsers.cpp] Remove unnecessary commodity allocation during XML load
    
    dom_tree_to_commodity_ref() is called for every transaction or
    price. It created and destroyed a commodity only to read its namespace
    and mnemonic when loading books. Rewrite to avoid creating temporary
    commodity.
    
    dom_tree_to_commodity_ref_no_engine () is called when creating
    commodities.
    
    Introduce get_commodity_ns_mnemonic() to parse namespace/mnemonic
    directly, and use it in both code paths.



Summary of changes:
 libgnucash/backend/xml/sixtp-dom-parsers.cpp | 59 +++++++++++++++++-----------
 1 file changed, 35 insertions(+), 24 deletions(-)



More information about the gnucash-patches mailing list