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
ChartView: update code for list-rendering #513
ChartView: update code for list-rendering #513
Conversation
chel-seyy
commented
Jan 25, 2019
•
edited by yamidark
edited by yamidark
@reposense/devs Ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a hypothesis, let me know if its not possible:
Currently, it seems that scripting takes a long time (hiding java file from Eugene in reposense_RepoSense_master)
Whereas collapsing and expanding all files are less computational intensive
Of course, given the amount of processing difference, there's definitely a difference.
However my point is, whenever the selectedFiles
or files
in this PR changes, it will trigger the code view to be reload which will create a lot of scripting tasks. So my question is, can we bypass the reload, using less processing power to produce same result by doing something similar to collapsing and expanding the files (just hiding the file content and header from the code view)?
Tried implementing your suggestion by hiding the files using After some searching, storing Also, Vuejs discourages https://vuejs.org/v2/style-guide/#Avoid-v-if-with-v-for-essential |
I see, great work for trying out alternatives.
In that case, could multiple vue instances be the causation of the crash in #451? |
There are certainly some examples of RepoSense/frontend/src/index.jade Line 84 in c0f5bfd
RepoSense/frontend/src/index.jade Lines 107 to 108 in c0f5bfd
Hence, they are not directly related to the crashing of the download feature. Perhaps I can open an issue about this, to improve vue's efficiency? On my side, I have changed the files rendering to use computed properties. However, I noticed that using computed properties does not speed up the selection process significantly. In fact, if I can push these latest changes up for you to compare the speed difference. |
Can try to move the following code-block out of The crash seems to be caused by vuejs going into an endless update. RepoSense/frontend/src/static/js/v_authorship.js Lines 211 to 213 in ee21b0d
Call it only when code view is open for a new author? It seems that the above code-block also tries to highlight code of other users as well 🤔. |
I have removed |
Nice, tested and barely feel any lag right now 👍. |
But I haven't find out which variable to |
If you toggle code views of different contribution, Even |
My attempt to fix the lag, with comments: yong24s@141a8e6 Test-site: https://yong24s.github.io/RepoSense Need help to make |
|
I meant to say I moved |
@yong24s By "hljs rendering" problems, do you mean the toggling of hidden (or non-authored) code? |
It don't always work in the code view. I'm not sure where to best put the |
one other way is to wrap the whole code thing into a component of its own and put the hljs inside the component, so one call will just be in charge of one "file" |
@chelseyong You want to work on the hljs optimization? I can create a new issue and assign it to you. Let this PR be code view optimization only. |
@yong24s Okay can |
Don't really see a different a response time when using the file type filter though. From testing of Eugene in reposense_RepoSense_master (loading of file types): Don't see much of a time difference between the two (and this PR actually may be slower!), and both still takes up a long time for scripting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes requested as above
@yamidark Okay, do you mean the scripting in the loading of tab? |
Nope, I meant the loading of all the files in the code panel, when after we hide all the files types and re-show them (uncheck and check the |
Noted, the message was not clear before. |
@chelseyong Well if you could improve the time for initial loading of all the codeview files as well, that will be good too 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm now that speed isn't much of an issue, perhaps focus on cleaning up?
@eugenepeh Okay. May I know what do you refer to as cleaning up? |
just pretty much whatever you're doing now, following suggestion given in https://vuejs.org/v2/style-guide etc. Let us know when you're done. |
@eugenepeh PR is ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chelseyong Remember to update the PR title and message since this PR objective change to that of cleaning up code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work by following best practices. 👍
Slight nits to proposed message:
@chelseyong Do add 'footnotes' in your message for when you want to provide additional info through a link |
@yamidark okay noted |