Page MenuHomePhabricator

Cache results of value suggestion based on constraints across tabs
Closed, DuplicatePublic

Description

When someone add a statement for property with one of value constraint value suggestion based on constraints is loaded which do the following thing:

  1. get list of suggested items based on P2302 statement (using wbgetclaims)
  2. get labels and descriptions of such items (using wbgetentities)

Both step have some performance issue:

  1. the result of wbgetclaims may be large (though this is not the primary issue - for P31 it is 154KB before gzip)
  2. if the first step returns many items the second step we need to get labels and descriptions of a large number of items (for P21 it is 49 items, which tasks about 500ms to load)

The result of both steps should be cached somehow (see the parent task).

Alternatively a dedicated API may be designed to get suggestions (including labels and descriptions) in one step, see also T111154: [Story] Entity suggester should also suggest values.