CCGE-BOADICEA / pedigreejs

A web tool for building pedigrees, https://ccge-boadicea.github.io/pedigreejs/
GNU General Public License v3.0
59 stars 42 forks source link

Re-rendering the pedigree very slowly. #110

Closed pyshawon closed 4 years ago

pyshawon commented 4 years ago

Hello developers, I'm developing pedigree with huge requirements. I'm using pedigreejs as a base of the project. Application is getting bigger day by day and now I'm facing an issue. Re-rendering the pedigree is very slow. Every change I did in settings > popup it calls the "REBUILD" function for re-rendering the pedigree. when you have a lot of things in the popup it takes time to render the pedigree.

Here is the demo of my application: https://pedigreejs.herokuapp.com/index.html

can anyone help me with how to overcome the slow issue ??

tcarver commented 4 years ago

It definitey is slower than our examples with the same pedigree size. I am not sure where your fork is and not sure what modifications have been made. It may be a question of revisiting some of your changes as well. In addition you may want to investigate updating the nodes dynamically to make the render more efficient?

pyshawon commented 4 years ago

@tcarver thank you for your response. we clone this repository 1 year ago. then we update it. Problem is we hire a Javascript developer and now he is gone, And I'm a backed python developer. I'm investigating the project. I'm not super good at Javascript but I understand if code is already written and I'm trying to understand. if you have some time can you please take a look at the code. I really need your help.

Here is the repository https://github.com/pyshawon/Pedigree

tcarver commented 4 years ago

I am not convinced it is the rendering that is taking the time. I don't have time to take a look at the code unfortunately but I would probably start by profiling and even by putting in console log message to follow what it is doing. I don't know but it might be repeatedly re-rendering unnecessarily. One thing I noticed, changing the legend settings and un-ticking some of the properties (just leaving 'Age and date of birth' and 'Name' ticked) speeds it up. Having 'cancers' ticked slows it down greatly. This may give some clues as to where the bottlekneck is.

legend_settings
pyshawon commented 4 years ago

Hay @tcarver thank you for the clues. I have rewrite the entire program and Now it is super fast. unfortunately, I can not share in public because some other API is linked with the code. The developer we hired before he doesn't know how to write code in better way. there were unusual loops and loop inside a loop that does nothing but eating time.

tcarver commented 4 years ago

Well done @pyshawon that is excellent that you resolved this.