cli: Speed up "result merge" by eliding db flush
When creating a new entity in the database, we were previously
immediately flushing, which would push the change into the database-side
transaction.
The benefit of this is that any query that gets made on the same session
after the flush but before the commit would include any entities flushed
but not committed in the results. But for our case, we already know that
all the entities we are merging are unique since we have already
"gathered" them into a set. So querying to see if an entity already
exists in the database would never return one of these pending entities.
Therefore, it is safe to remove the immediate flush, and just wait until
the final commit to push things to the database. This speeds up merge
operation by more than 2x.
Signed-off-by:
Ryan Roberts <ryan.roberts@arm.com>
Loading
Please register or sign in to comment