Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upperformance regression introduced by fix for #84 #101
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ncb000gt
Jul 30, 2014
Collaborator
Sorry, I must have missed this issue in my email. I'll take a look. Thanks.
|
Sorry, I must have missed this issue in my email. I'll take a look. Thanks. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Marak
Nov 13, 2014
I can confirm that there is a performance issue in _getNextDateFrom method.
I have a browserify version of the package and when putting in any dates that are somewhat far into the future it melts the browser. Did a trace and saw the while loop in _getNextDateFrom executing way too much.
Marak
commented
Nov 13, 2014
|
I can confirm that there is a performance issue in I have a browserify version of the package and when putting in any dates that are somewhat far into the future it melts the browser. Did a trace and saw the while loop in |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Marak
commented
Nov 13, 2014
|
Confirmed that reverting back to |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ncb000gt
Nov 13, 2014
Collaborator
Thanks for confirming. I'm making my way through the tickets and this is definitely one I'll be looking into, albeit slowly. I'll post more when I have more info.
|
Thanks for confirming. I'm making my way through the tickets and this is definitely one I'll be looking into, albeit slowly. I'll post more when I have more info. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Closing due to age. Can create a new ticket if it comes up again. |
jkryl commentedJul 16, 2014
By profiling my application which uses cron module I have discovered that a lot of time is spent in _getNextDateFrom() method. Further investigation showed that it is a regression of fix for "Update for fixing node-cron to better handle DST. #84". Number of iterations to determine next run of a cron job in _getNextDateFrom() can be ~3000 with fix for #84 and here is the reason for it:
as can be seen after the second goes 59 -> 00, the minute is incremented by one, which is wrong. Search then continues by searching for minute again and so on. Also the code in _findDST() seems to be quite inefficient, incrementing seconds by one until we step over DST shift can result in 60*60 extra cycles if I'm not mistaken. Also I don't see a reason why this function should be called when adjusting day of a week. In general it would be nice if function had an explanatory comment describing how it works.