How to improve jqPlot parseOptions/jquery.extend performance -
i have app uses jqplot , want create perform improve - i.e. have render charts faster.
using firefox profiler, i'm able drill downwards on time beingness spent in various parts of code, , i've found phone call jqplot takes ~85% of time. of 85%, ~60% spent in jqplot.draw routine , ~20% taken in jqplot.parseoptions routine.
in add-on static configuration info (legend related stuff, grid related stuff, cursor , highlighter stuff, , x, y, y1, , y2 axis info), actual chart info passed in alternative object jqplot. chart info includes series data, series options, , label ticks.
jqplot copies of stuff it's own memory, , function called parseoptions uses jquery.extend() function work. jquery.extend function appears general purpose re-create function knows how deal info types , objects, generalized function it's not optimized 1 of them.
my first effort seek pass in static options on phone call jqplot, , utilize jqplot.replot() pass series data, series options, , ticks chart object (to avoid extend in parseoptions). failed, , after traced through code discovered replot accepts line plot info (x,y points) , not take ohlc info (as these charts composed of). next tried passing ohlc info in initial phone call jqplot , passing series options , ticks in subsequent phone call replot, although (limited) jqplot documentation says replot take options, it's not total alternative set , ones needed weren't handled.
my next effort create series_options "lighter". primary series info chart uses ohlcrenderer, , other series utilize linerenderer. current code has linerenderer set default, , each series_option object has override specifying ohlcrenderer. each of these ohlcrenderer override references in series_option objects has multiple objects beneath them - function prototypes , other stuff. since there few of non-sample/wafer types compared sample/wafer objects, changed things around create ohlcrenderer default , added linerenderer overrides other objects. thought removing many object references speed parseoption process, had no appreciable difference (if anything, seemed little slower since profiling course of study it's not clear).
i'm out of ideas @ point. have ideas speed chart rendering?
jquery performance jqplot
No comments:
Post a Comment