Ladsgroup added a comment.

  In T249587#6078864 <https://phabricator.wikimedia.org/T249587#6078864>, 
@Addshore wrote:
  
  > One thing to note in the profiling is that a significant portion of the 
time that the query is executing is spent in a section of code in 
ApiResult::addValue, specifically the validateValue and size methods.
  > I don't think we really need to do this, but we should consult with the 
core platform team and potentially remove this from the execution path for our 
apis?
  > An equal amount of time seems to be spent in 
Wikibase\Lib\Serialization\SerializationModifier::modifyUsingCallback which 
could likely do with some optimizations.
  > Noticeably in this call property id creation seems to take quite some time, 
it looks like the bulk of this overhead is due to joining and splitting around 
id prefixes, which we do not actually use.
  > @Ladsgroup recently filed a ticket about the performance of EntityId and 
ItemId etc.
  > I think we could make an improvement here probably by not doing so much 
logic in the constructor when we don't need to.
  > Perhap we can also just remove all of this id prefix stuff for now as we 
don't use it.
  > It'll be good to try and get a full profile of a completed execution.
  > To do that we will have to see if we can temporarily remove the timeline 
restriction on one of the mwdebug servers.
  
  Thank you for running the performance inspections and it's very useful but we 
should check memory instead of time, they actually have a trade-off. For 
example if we try to to cache property objects so it wouldn't spend time 
checking the regex, it would be faster but it would use more even memory and 
worsens the situation mentioned in this ticket. Checking the memory explosions:
  
    Wikibase\Lib\Serialization\SerializationModifier::getPathParts
        138,755,064 bytes
    Wikibase\DataModel\Entity\EntityId::extractRepositoryNameAndLocalPart
        73,650,136 bytes
    Wikibase\DataModel\Entity\EntityId::extractSerializationParts
        71,232,576 bytes
    Wikibase\DataModel\Snak\PropertyValueSnak::unserialize
        66,952,800 bytes
    
Wikibase\Lib\Serialization\CallbackFactory::Wikibase\Lib\Serialization\{closure}
        64,796,608 bytes
    Wikibase\DataModel\Snak\SnakList::unserialize
  
  I guess data model needs a little tuning in storing values.

TASK DETAIL
  https://phabricator.wikimedia.org/T249587

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Ladsgroup
Cc: Ladsgroup, Lea_Lacroix_WMDE, Addshore, Ixocactus, Tarrow, Magnus, Aklapper, 
darthmon_wmde, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, 
_jensen, rosalieper, Scott_WUaS, Jonas, Wikidata-bugs, aude, Lydia_Pintscher, 
Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to