Closed wmdietl closed 7 months ago
@flo2702 Can you have a look at the performance difference between using the Initialization Checker and disabling it? Maybe you see something else that impacts performance?
The newest changes in https://github.com/eisop/checker-framework/pull/657/commits/6109041c90ead352793e497da2ad6f21465c2ad3 re-enable caching in getAnnotatedTypeLhs
for variables declared using var
.
This only has an effect on the initializer expression, avoiding that its type is re-computed multiple times.
The expanded tests in https://github.com/eisop/checker-framework/pull/657/commits/43babac00e8dd80ec94234195c8bae36da3b22c7 make sure that re-assignment to such a variable doesn't cause re-computation.
With initialization, using both Object
and var
, the time is now roughly equal, at around 45s.
Some timing:
Before this PR:
var
, with init: 165svar
, assume init: 90sObject
, with init: 50sObject
, assume init: 33sAfter this PR:
var
, with init: 105svar
, assume init: 60sObject
, with init: 45sObject
, assume init: 30sThere is still a large difference between using
var
and usingObject
, which we should investigate more.typetools, at https://github.com/typetools/checker-framework/commit/f58c9d93d562c923d2fea17fec978eb2b8040858 (commit before https://github.com/typetools/checker-framework/commit/dc0e62c36818cf76762a4357bbb597d559cbbb28):
var
: 43sObject
: 42stypetools, at https://github.com/typetools/checker-framework/commit/dc0e62c36818cf76762a4357bbb597d559cbbb28:
var
: 90sObject
: 42stypetools, at https://github.com/typetools/checker-framework/commit/ccec69e53393e3c6dbbbc7bc53f8ad60be6fd679 (this test case crashes on typetools HEAD):
var
: 115sObject
: 43sSo, this PR gets eisop in line with typetools (which is good, given eisop splits init and nullness), but doesn't undo the performance hit from improved
var
support.Co-authored-by: Liam Miller-Cushon cushon@google.com