Speed up JSON-AD Serialization
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.6k
- Forks
- 82
- Avg merge
- 10h 34m
- Merged PRs (30d)
- 205
Description
Apparently, in some local tests the server responds faster to JSON-LD or TTL requests (4ms average in dev mode) then JSON-AD (6ms). This is weird, since the JSON-LD and TTL versions fetch all the individual properties, which means they should be far slower than JSON-AD. Something weird is going on, probably inside propvals_to_json_ad_map.
But still... The median response with normal concurrency is 1ms on my laptop, so performance wise, this is not a priority at the moment.
EDIT: Serializing a JSON-AD resource can take up to 1ms for collections. That's way too slow!
I've added a benchmark, and it had serialisation times of 70us for /collections in JSON-AD, 100us for JSON-LD and JSON, and 140 for Turtle. I expected this order, but would still expect JSON-AD to be way faster, since the others need to fetch Properties for every Key, whereas JSON-AD does not have that dependency. JSON-LD serialisation does not even use Store! So I don't get why it's relatively slow.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the existing serialization benchmark and inspect propvals_to_json_ad_map, comparing JSON-AD timings with JSON-LD, JSON, and Turtle for collections. Done means identifying why JSON-AD serialization is relatively slow and recording improved benchmark results or a clear explanation of the remaining cost.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100