Parsing happens rotationally on the translation units.
The recently parsed translation unit is used for completion jobs while
the older version is used for parse jobs.
Advantages:
A1. A completion job cannot be blocked anymore by currently running
parse job.
A2. Faster triggering of parse jobs. A reparse was triggered about
1650ms after the last keystroke. This is down to 500ms now since we
do not have a blocking translation unit for the completion anymore.
Disadvantages:
D1. Memory consumption is doubled for an edited document.
This could be addressed by suspending the second translation unit
after some time of inactivity.
D2. Setup of the supportive translation unit takes some time.
Change-Id: I958c883c01f274530f5482c788c15cd38d6f4c3e
Reviewed-by: David Schulz <david.schulz@qt.io>
A TranslationUnit is owned by TranslationUnits now. TranslationUnits
allows to add another TranslationUnit and to update/query the recently
and previously parsed translation unit.
This does not change any behavior yet.
Change-Id: I8a2f0cc05d3e51bf739dd5d7c4da14b54147f3ab
Reviewed-by: David Schulz <david.schulz@qt.io>