3 of 4
edited tags

xkcdConvert routines perform slower in Mathematica 9

I am experiencing some rather large performance decreases in Mathematica version 9.0 using the xkcd-styled plotting routines.

I had used the xkcdConvert code from Simon Woods as seen here (also described/annotated by Vitaliy Kaurov, as seen here) a few months back under version 8.0.4. This code worked great under version 8.0.4 and ran the following sample code in about 1.68 seconds:

f1[x_] := 5 + 50 (1 + Erf[x - 5]);
f2[x_] := 20 + 30 (1 - Erf[x - 5]);
xkcdConvert[
  Plot[{f1[x], f2[x]}, {x, 0, 10}, 
   Epilog -> 
    xkcdLabel /@ {{"Label 1", {1, f1[1]}, {1, 30}}, {"Label 2", {8, 
        f2[8]}, {0, 30}}}, 
   Ticks -> {{{3.5, "1st Event"}, {7, "2nd Event"}}, 
     Automatic}]] // AbsoluteTiming

This code will produce a simple xkcd-styled plot as given by Simon Woods example.

When I run the same code under version 9.0, the output takes ~17.0 seconds to produce!? I'm not sure why the performance degradation is happening in version 9.0.

I was hoping to produce a number of comic styled plots for a meeting. I have produced the desired plots, but all the plot-rendering took a really long time (one plot took ~8 minutes to render).

I welcome insight on how to improve the rendering performance under version 9.0 for future rendering efforts!

Joseph
  • 1.3k
  • 11
  • 19