edyonil / jsgantt

Automatically exported from code.google.com/p/jsgantt
0 stars 0 forks source link

Speed is too slow for large projects #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi.

I try to apply for a large project (> 100 jobs), the speed is very slow 
and can not do anything on the browser during that time. 

Do you have any solutions for this?

Original issue reported on code.google.com by haokm...@gmail.com on 13 Mar 2009 at 10:00

GoogleCodeExporter commented 9 years ago
are there a lot of dependencies? We find that it is the most time consuming 
task of 
jsGantt

Original comment by shlomyga...@gmail.com on 16 May 2009 at 7:01

GoogleCodeExporter commented 9 years ago
I have the same problem. I think this is because of using many and many table 
cells
for displaying day cells in right table.
So, i'd like to propose using background images instead of writing many tables 
with
cells. Then for displaying one row instead of 
<div>
   <table>
     many many cells
component create something like
<div 
style="background-image:url(\'img/tableback.png\');background-repeat:repeat-x;">

But in your css file you wrote about problems with nested divs and I don't know 
if
this problems occures with styles. I test this solution under ff 3.0 and it 
works
without problems and much faster even for your example data in index.html. It 
also
works under IE 8 in compatibility mode.

So, what are you thinking about this soluton?
I have working example with many bugs in other modes except 'days' and it is
localized on Russian language, but it works.

Feel free to ask me questions.
Thank you for the good solution.

Original comment by sergey.p...@gmail.com on 21 Oct 2009 at 7:49

Attachments:

GoogleCodeExporter commented 9 years ago
I have this same issue.  Pretty fast in Chrome, but in IE8 (compatibility), 
it's eating 
CPU cycles just scrolling around and such.  Also you might consider changing 
the style 
of the javascript to use prototypes rather than this.xxx = function(){} so that 
only a 
single instance of the function is created for each item.  You could then get 
rid of 
the vast majority of the getter/setter functions.

Original comment by goofyg...@gmail.com on 12 Nov 2009 at 10:30

GoogleCodeExporter commented 9 years ago
Ive slightly optimized my version, by replacing all the calculations 60 * 1000 
and 24 * 
60 into variables:

var sixtyTimesThousand = 60 * 1000; 
var twentyFourTimesSixty = 24 * 60;

And wherever there was 60 * 1000 now use sixtyTimesThousand etc.

Original comment by therevil...@gmail.com on 13 Nov 2009 at 3:06

GoogleCodeExporter commented 9 years ago
therevillsgames
Did you see higher performance?

Original comment by sergey.p...@gmail.com on 13 Nov 2009 at 6:44

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
@sergey

Yes, on my chart I have got 40 items with 3 dependencies, when I viewed the 
chart 
using the Hours mode it would hang the browser and use 100% CPU, now with my 
"fix" it 
is quicker and with the same data set it only take a few seconds to view the 
chart in 
the Hours mode.

Original comment by therevil...@gmail.com on 15 Nov 2009 at 9:44

GoogleCodeExporter commented 9 years ago
Just tried it with 80+ items still freezes the browser in "Hours Mode", even 
with your 
fix too... 

Original comment by therevil...@gmail.com on 15 Nov 2009 at 9:59

GoogleCodeExporter commented 9 years ago
@therevillsgames
I don't need "Hours mode" and i don't see the code for this mode, so i can't say
anything with this.

Original comment by sergey.p...@gmail.com on 15 Nov 2009 at 10:27

GoogleCodeExporter commented 9 years ago
Did it freezes the broser all over the time ot just when page load? If 1st, 
then i
think you need to simlify markup, if 2nd then you need javascript profiling.

Original comment by sergey.p...@gmail.com on 15 Nov 2009 at 10:32

GoogleCodeExporter commented 9 years ago
Ive set up my chart to have day and hour mode and when it loads it defaults to 
day 
mode, this is fine and nice and quick.

Ive tested on IE6, FF3 and Chrome3, all 3 freezes when I do hour mode with 80+ 
items.

Original comment by therevil...@gmail.com on 15 Nov 2009 at 10:37

GoogleCodeExporter commented 9 years ago
Okay, found out that there is an infinite loop when it builds up the "Minor 
Date 
header and Cell Rows".

For some reason this bit of code doesnt work on some instances:

if (vFormat == 'hour')
                                              {

                                                if(  vTmpDate.getHours() ==0  ) 
                                                  vWeekdayColor = "ccccff";
                                                else
                                                  vWeekdayColor = "ffffff";

                                                vDateRowStr += '<td class="ghead" 
style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; 
BORDER-LEFT: 
#efefef 1px solid;"  bgcolor=#' + vWeekdayColor + ' align=center><div 
style="width: 
'+vColWidth+'px">' + vTmpDate.getHours() + '</div></td>';
                                                vItemRowStr += '<td class="ghead" 
style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px 
solid; cursor: default;"  bgcolor=#' + vWeekdayColor + ' align=center><div 
style="width: '+vColWidth+'px">  </div></td>';

                                                vTmpDate.setHours(vTmpDate.getHours() 
+ 1);
                                                alert(vTmpDate.getDate() +" " 
+vTmpDate.getHours());
                                              }

In my chart I add a set of task with a date/time (dd/mm/yyyy HH:mm) and 
depending on 
the range it gets stuck adding +1 to hours...

Original comment by therevil...@gmail.com on 16 Nov 2009 at 2:39

GoogleCodeExporter commented 9 years ago
Folks,
I am happy to announce that after being silent for a while, JSGantt is in the 
process 
of being re-built FOR SPEED. We appreciate all your comments and are working 
hard on 
making this product scale. 

What started as a small project based on a bet with another developer has grown 
exponentially and we have had a hard time keeping up. 

Shlomy

Original comment by shlomyga...@gmail.com on 16 Nov 2009 at 8:03

GoogleCodeExporter commented 9 years ago
@shlomygantz
Thank you very much. And yes, this is a great solution already.

Original comment by sergey.p...@gmail.com on 16 Nov 2009 at 8:58

GoogleCodeExporter commented 9 years ago
@shlomygantz
Thanks!

BTW just figured out why the browser was hanging with the "Hour Mode".

The code:
vTmpDate.setHours(vTmpDate.getHours() 
+ 1); 

Doesnt work with Daylight Savings!!! Ill raise another defect to cover this, 
but the 
fix is: vTmpDate.setTime(vTmpDate.getTime() + 3600000);

Original comment by therevil...@gmail.com on 16 Nov 2009 at 9:04

GoogleCodeExporter commented 9 years ago
Also seeing absolutely dreadful performance here with anything upwards of 20 
tasks on "day" view.

Does replacing all of the tables with divs really improve performance? Does 
anyone have any other tips?

@Shlomy, is there really progress being made on a new version "built for speed"?

Original comment by danepow...@gmail.com on 27 Sep 2010 at 10:26

GoogleCodeExporter commented 9 years ago
hi any other fixes any one found for that i am using project where data has to 
come for almost four years and for me its hanging in day mode itself, is there 
any solution to load data dynamically depending on scroll value of the chart ?

Original comment by rahul....@gmail.com on 18 Sep 2012 at 7:30

GoogleCodeExporter commented 9 years ago
Hey Guys,

i am using latest version of jsgantt and i have thousands of task. Its hanging 
browser for a long time. Its still loads in FF but in IE it never loads.This 
lag is only because its inserting large html code into DOM. May be usng DIV 
instead of tables help.

Any suggesstions?

Original comment by ravigarg...@gmail.com on 30 Nov 2012 at 8:02