Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "[account.cpp] gnc_account_remove_split searches from the end"
This reverts commit 5aff4fb. Was not tested properly...
- Loading branch information
038405b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this works but looks like a bad hack!
038405b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok it may be a hack but it's effective in speeding up the majority calls to remove_split. Any objections to specialising the last vector element prune?
038405b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was wrong with 5aff4fb?
Why not just leave the account splits vector alone when deleting transactions during book shutdown and let the account clear the vector when it's destroyed?
038405b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It causes failures https://github.com/Gnucash/gnucash/actions/runs/9174735832/job/25226214027
Because
qof_instance_get_destroying(acc)
isn't set yet while transactions clear the splits.038405b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong thing to check.
qof_book_shutting_down
should be already set. If it's not that's a separate problem.038405b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to bypass the split operations if
qof_book_shutting_down
but the benchmark show e80249c improves from 0.6s to 0.32s and usingqof_book_shutting_down
to bypasspop_back()
improves to 0.31s only.038405b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, they're both doing the same thing, avoiding creation of the iterators. You complain that the
pop_back
way looks like a bad hack, so I offered a different way.But either way it's hard to get excited over 1/3 second speedup when shutting down the program.