Perf/efp single request#181
Open
VinLau wants to merge 3 commits into
Open
Conversation
…ce upgrades (like ePlant 2)
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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.