Skip to content
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

SeqQC: .is(':visible') needs to be refactored where possible #335

Open
jmtcsngr opened this issue May 25, 2016 · 1 comment
Open

SeqQC: .is(':visible') needs to be refactored where possible #335

jmtcsngr opened this issue May 25, 2016 · 1 comment

Comments

@jmtcsngr
Copy link
Member

Using $.is(':visible') has proven to be considerably slow when applied to a significant number of objects. Re-factor where possible as css rules so is not executed inside loops. We suspect it traverses the DOM each time it is executed to find if the element and its parents are part of subset of elements in the DOM (visible ones). An example of this situation is the code which generates d3 plots. The problem seems to be significantly worse with firefox.

@jmtcsngr
Copy link
Member Author

jmtcsngr commented Dec 4, 2017

$ git grep -n -i "is(':visible')"
npg_qc_viewer/root/static/scripts/plots.js:38:      if ( self.is(':visible') && self.children().length === 0 ) {
npg_qc_viewer/root/static/scripts/plots.js:68:      if ( self.is(':visible') && self.children().length === 0 ) {
npg_qc_viewer/root/static/scripts/plots.js:104:      if ( self.is(':visible') && self.children().length === 0 ) {

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

No branches or pull requests

1 participant