Skip to content

change the way flot update #1247

Closed
wants to merge 1 commit into from

3 participants

@Klamtine

the origin way is using a recursion, it's fine when there is only one data, when multiple data come in, recursion can cause performance problem.

Klam change the function flot update
the origin way is using a recursion, it's fine when there is only one data, when multiple data come in, recursion can cause performance problem.
83bc030
@dnschnur
Flot member

Could you explain how the existing code is recursive? The first call to update returns immediately after scheduling the second call via setTimeout.

Your change actually prevents the plot from drawing on page load, since the first call only happens after the interval expires. That is barely noticeable on account of the short default interval, but it still doesn't seem like an improvement.

@dnschnur dnschnur added the triage label Feb 12, 2014
@Klamtine

Oh, I got what you mean. I used to put four groups of data in setData() at 30ms and feeling uncomfortable, actually it's much better at 1s or more. I used to treat setTimeout as a function calling it self, but it seems like an event: it triggers after sometime and return(or destroy?).

And my code make a gap between page load and plot draws, it's not friendly. I got it, thank you. I'll think twice before I made any suggestions, thanks again!

@nschonni nschonni closed this Feb 12, 2014
@dnschnur dnschnur added invalid and removed triage labels Mar 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.