This ticket was created after investigation done as part of T253125: Federated Properties, ApiEntityLookup, trying to get data that was not prefetched..
The bulk of the content of this ticket comes from the following 2 comments T253125#6162897 T253125#6163636 (more details there)
EntityInfo as a concept is not currently intentionally used and should be removed.
EntityInfo was introduced back in the day to "prefetch" entity info needed for rendering a page, this includes terms needed for rendering a page
Introduction of formattercache for term lookups stopped using EntityInfo in most cases
Despite not using the EntityInfo, it hasn't since been cleaned up / removed (I seem to remember there being a ticket relating to this? but I can't find it)
The EntityInfo lookup does appear to be used for some things such as formatting of coordinate globes or also numeric units.
These cases should just use the new thing.
Impact of removal
The current rate of requests to this EntityInfo builder stuff: https://grafana.wikimedia.org/d/u5wAugyik/wikibase-statsdrecordingsimplecache?panelId=2&fullscreen&orgId=1&from=now-1h&to=now
The rate of requests for EntityInfo is essentially the same as the # of parser output generations for wikibase data.
Looking at the cache metrics
In a 12 hour period this is ~120million calls, so 10 million an hour, or 166k per min or ~2700 calls per second
The cache hits come from local server cache, but the misses result in lookups from the terms storage db tables.
We also track the db calls for this code path that may not be needed on https://grafana.wikimedia.org/d/000000548/wikibase-sql-term-storage?orgId=1&refresh=30s
You can see these in the top panel for the "select.EntityInfoBuilder_collectTermsForEntities" metric.
Averaging 4.7k ops a second/minute (TBA confirm this??)
Needless to say that not doing all of this stuff that is not needed should speed things up and reduce memory consumption.
It will also remove an old outdated concept that should have been killed some while ago.