-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review the Javascript about the evidence table for performance and code quality. #726
Labels
Comments
marco-brandizi
pushed a commit
that referenced
this issue
Mar 10, 2023
marco-brandizi
pushed a commit
that referenced
this issue
Mar 10, 2023
lawal-olaotan
added a commit
that referenced
this issue
Mar 10, 2023
lawal-olaotan
added a commit
that referenced
this issue
Mar 10, 2023
lawal-olaotan
added a commit
that referenced
this issue
Mar 10, 2023
marco-brandizi
added a commit
that referenced
this issue
Mar 13, 2023
marco-brandizi
added a commit
that referenced
this issue
Mar 14, 2023
When cutting the initial list to the top 100, such list needs to be sorted. See #727 regarding getting this from the API. This is still on a branch and needs unit tests + UI tests. |
lawal-olaotan
added a commit
that referenced
this issue
Mar 16, 2023
@lawal-olaotan the initial table sorting is still wrong, see last comments. The other TODOs are not urgent. |
marco-brandizi
added a commit
that referenced
this issue
Mar 16, 2023
marco-brandizi
added a commit
that referenced
this issue
Mar 16, 2023
marco-brandizi
added a commit
that referenced
this issue
Mar 16, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The function
createEvidenceTable()
inevidence-table.js
has poor code that performs badly.values
is a bad name, it actually meansrow
orrowValues
values[0], values[1], values[] everywhere is kindergarten programming, which makes the code unreadable and error-prone. At the top of the row-rendering iteration, it should have something like:
And then the semantically-meaningful names should be used, not the damn indices, even Assembler programmers use symbolic constants to index memory!
userGenes
is turned into an array (viaString.split()
) for the sole purpose of counting how many genes there are in the string. This is likely to be the performance bottleneck we're currently experiencing.The count should be based on the no. of ',' (in a non-empty string) + 1. Write a support function (or use some existing lib) to count the occurrences of a substring in another via
indexOf()
, as shown here.==> this is a temporary quick fix, the alternative is to take more time to change the API and make it return the count.
Write a support function (even an anonymous in-line function is better than the current copy-paste mess) which loops over rowsLimit = range of 50, 100, 200, 500, 1000 and writes the
<option>
row only once.Generally speaking, in future we should review these mixes of HTML and javascript, see #725
The text was updated successfully, but these errors were encountered: