speed up file loading with many prices

Herbert Thoma tma at iis.fhg.de
Thu Jun 2 15:46:40 EDT 2005


Hi!

On 2004-10-31 Phil Longstaff's patch to prevent duplicate pricedb
entries was merged. I like this functionality but it has one
drawback: Every time a new price is inserted this price is
compared to all allready existing prices. This slows down file
loading if there are many prices in the file. E.g. in my current
datafile are about 15000 prices and it takes about 40 seconds to
load. If the duplicate check is disabled the loading takes less
than 2 seconds.

I added a parameter check_dupl to gnc_price_list_insert and in
turn to gnc_pricedb_add_price. Then check_dupl is set to FALSE
when loading files and to TRUE when adding prices manually or
online.

Modified files:
src/engine/gnc-pricedb.c
src/engine/gnc-pricedb.h
src/engine/gw-engine-spec.scm
src/engine/test-core/test-engine-stuff.c
src/backend/file/gnc-pricedb-xml-v2.c
src/backend/file/io-gncbin-r.c
src/backend/file/io-gncxml-v1.c
src/gnome-utils/dialog-transfer.c
src/gnome/dialog-price-editor.c
src/gnome/druid-stock-split.c
src/scm/price-quotes.scm

makepatch patches for head and stable branches are attached.

  Herbert.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnucash-20050602-205056-herbie.head.diff.gz
Type: application/x-gzip
Size: 18386 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20050602/01b700ba/gnucash-20050602-205056-herbie.head.diff-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnucash-20050602-205724-herbie.stable.diff.gz
Type: application/x-gzip
Size: 18060 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20050602/01b700ba/gnucash-20050602-205724-herbie.stable.diff-0001.bin


More information about the gnucash-devel mailing list