We're updating the issue view to help you get more done. 

Improve URL signing performance

Description

The performance of URL signing is critical for External API request that retrieve publications of events where each URI of each published elements needs to be signed.

The current implementation does a brute force comparison of the URL to be signed vs. the URL prefixes that can be signed. This is not only because of the algorithm that is in O(n) but it also seems that the functional implementation requires some high-overhead transformations of data structures.

The goal of this task is to use a O(log(n)) algorithm and avoid expensive transformations of data structures.

Benchmark:
GET /api/events/{event_id}?withpublications=true&sign=true for a event with approx. 40 URLs to be signed takes approx. 40ms with the current code and 30ms with this optimization, whereas approx. 20ms are required without URL signing. So the overhead of enabling URL signing is cut in half.

Steps to reproduce

None

Status

Assignee

Sven Stauber

Reporter

Sven Stauber

Criticality

None

Tags (folksonomy)

None

Components

Fix versions

Affects versions

7.0

Priority

Major