Skip to content

Perf/efp single request#181

Open
VinLau wants to merge 3 commits into
stagingfrom
perf/efp-single-request
Open

Perf/efp single request#181
VinLau wants to merge 3 commits into
stagingfrom
perf/efp-single-request

Conversation

@VinLau

@VinLau VinLau commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Synopsis:

So this PR just makes an update to the URL/URI encoding that was happening before. More or less there was multiple (5+; depending on how many samples a view had) calls to the webservice which fetches the tissue/sample data for SVGs/eFP views because it was afraid of the URL being too long and make the loading bar more smooth (load pieces of data instead at once). So a bunch of API calls were strung together. Had to make some minor modifications too to enable one long URL GET request versus 20 small ones.

This PR shrunk the calls to webservice from 200+ to 45.

image image

Detailed:

Previously we split that list into chunks of 20 samples and fired a separate request for each chunk — so one view could make 5+ requests, and loading all views for a gene meant 200+ requests at once. This changes it to one request per view, matching how the older ePlant 2 app worked. The chunking existed only to make the loading bar move more smoothly. In practice it multiplied network traffic for no real benefit and added load on the server. A single request is simpler and faster; the progress bar now steps at greater intervals instead of mini-steps but it's a worthy tradeoff.

NB: The old code encoded the sample list with encodeURIComponent(JSON.stringify(names)) encodeURIComponent makes many chars into 3-char codes which made some URLs too long for large views. This wasn't a problem before but now to fix the 414 we dropped encodeURIComponent and sent JSON.stringify(names) directly. Also sample names containing + or spaces were being misread by the server, but it's fixed now.

VinLau added 3 commits June 18, 2026 04:45
…or - too much encoding caused it to make the URI too long
…retation particularly for BioticStressErysipheorontii which contains plus signs which mess up URI encodings
@VinLau VinLau requested review from Yukthiw, bdls-jamal and mwkyuen June 18, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant