Skip to content
Commit e21f1779 authored by Ryan Roberts's avatar Ryan Roberts
Browse files

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's avatarRyan Roberts <ryan.roberts@arm.com>
parent 443d8241
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment