wmde/WikibaseDataModel

Move away from entity type + numeric id format in EntityIdValue

Closed this issue · 5 comments

unserializing the EntityIdValue (e.g. from memcached) from the entity type + numeric id format to an EntityId object has significant impact on performance and memory usage.

The unserialization uses the PropertyId::newFromNumber and ItemId::newFromNumber methods are memory intensive, with use of strtr (#5 in https://github.com/filbertkm/wb-profiling/blob/master/memory_own-itempurge-1.25wmf1.txt).

If we can somehow move away from entity type + numeric id format in EntityIdValue, I think that would be better.

We have a bug on bugzilla already about EntityIdValue which people poked at recently. We all agreed that we should make this change way back when we propped the notion that ids have configurable prefixes. This is one of the few places where we've not gone ahead yet, since it's a breaking change in the public API of the wider Wikibase software (ie Wikidata API clients need updating).

Solved via #671.

Just a note, it's fixed via #718, #248 is this PR itself :)

#718 was about PHP's native serialize, which is unrelated. This issue here was solved with #671.