weso/Wesby

Very slow retrieval of resource labels

Closed this issue · 1 comments

When a resource is not cached Wesby has to retrieve the label from the resultQuery, causing major lag in the request when there is a big number of predicates.

The problem seems to be in method Utils.label(resultQuery: ResultQuery): String.

The cache problem is discarded, I tested the application with a local setup of memcached and it only fails the first time the resource is requested.

Work in progress...

I set up a local Fuseki server with a few heavy resources and it works pretty well with the local cache.
The first time a resource is requested the server takes about 7-8 seconds to answer, however the successive requests are instantaneous (because the labels are cached).

The 7-8 seconds lag is caused by the SPARQL queries to the endpoint. With the Javascript progress indicator is kind of bearable but a possible solution can be to delay somehow part of the queries (maybe on demand by the user with AJAX requests like a "load more" button?)

My bet is that the issue was a combination of poor response times by the endpoint and slow cache server.

To change the memcached server just replace memcached.host value in application.conf