开发者

Web Workers and Sparklines

开发者 https://www.devze.com 2023-01-06 04:06 出处:网络
I know that Web Workers don\'t have access to the DOM, but I was wondering if there was any way they could render a Sparkline graph behind the scenes and pass it back. If not, is there ANY way I could

I know that Web Workers don't have access to the DOM, but I was wondering if there was any way they could render a Sparkline graph behind the scenes and pass it back. If not, is there ANY way I could use Web Workers to speed up the processing of ar开发者_JS百科ound a million sparklines?

I'm trying to improve performance (see this question)


If you look at this article: http://hacks.mozilla.org/2009/07/working-smarter-not-harder/ you can just pass back the points to be graphed (x,y coordinates) and then when you post the message the receiving end will just need to process it (graph it).

So, your performance hit will be in the rendering of each graph, if you profile your application that will be the part that becomes the bottleneck.


Why render them on the client side anyway? Try the Google Chart API http://code.google.com/apis/chart/docs/gallery/line_charts.html.

0

精彩评论

暂无评论...
验证码 换一张
取 消