Issue #3131585 by Berdir, alexpott, daffie: Performance regression caused by using the last installed entity definitions