Re: Behaviour of Plot/ListPlot & Export
- To: mathgroup at smc.vnet.net
- Subject: [mg31764] Re: [mg31722] Behaviour of Plot/ListPlot & Export
- From: SteveC <steve at fractalus.com>
- Date: Sat, 1 Dec 2001 02:44:57 -0500 (EST)
- References: <200111290513.AAA22173@smc.vnet.net> <8E77728D5EF5@ch1.irl.cri.nz>
- Sender: owner-wri-mathgroup at wolfram.com
* Manfred Plagmann (m.plagmann at irl.cri.nz) wrote: > 100. There is no bug, it is a feature! Point taken - I assumed it would behave the same a Table :-) I was wrong. > In your case of slow image saving I suggest you save each image right after > it is created as I have never noted any delays when I had just a few images Ok lets quantify this and clear up a few things: My machine has 1 Gigabyte of memory, it pretty much *never* uses the swap partition. The CPU usage during an export of an animated gif is most of the time 0%. Literally. Every now and then the cpu usage will go to something like this: PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND 5458 steve 15 0 5244 5244 2500 S 0 7.9 0.5 0:06 MathKernel 5450 steve 12 0 5764 5764 3112 S 0 6.9 0.6 0:08 Mathematica 5460 steve 11 0 448 448 292 S 0 2.9 0.0 0:02 PNM.exe 5402 steve 11 0 1348 1348 1140 S 0 1.5 0.1 0:21 mpg123 As you can see, playing an mp3 uses a comparable amount. Strange huh? Now, Lets export one image: Timing[Export["a.gif", Table[ Show[Graphics[Line[{{0, 0}, {1, 1}}]]], {x, 0, 100}]] ] Result: {0.14 Second, "a.jpg"} Now lets time exporting 100: Timing[Export["a.gif", Table[ Show[Graphics[Line[{{0, 0}, {1, 1}}]]], {x, 0, 100}]] ] {9.11 Second, "a.gif"} This is what you'd expect, but in fact it takes a *lot* longer: a = Date[]; Timing[Export["a.gif", Table[ Show[Graphics[Line[{{0, 0}, {1, 1}}]]], {x, 0, 100}]] ]; Date[] - a result: {0, 0, 0, 0, 3, -1} So lets say on the order of 3 minutes. Thats a bit bigger than 10 seconds, and as noted most of that time is spent doing nothing. Anyway might as well spend some time running an strace on it. Mathematica appears to spend a lot of time on these: write(3, "\17\2\2\0\7\6\340\2", 8) = 8 read(3, 0xbfffe6b0, 32) = -1 EAGAIN (Resource temporarily unavailable) and oldselect(1024, [], [], [17], {0, 0}) = 0 (Timeout) write(17, "\\C", 2) = 2 oldselect(1024, [18], [], [], {0, 0}) = 1 (in [18], left {0, 0}) oldselect(1024, [18], [], [], {0, 0}) = 1 (in [18], left {0, 0}) read(18, "\\c", 1024) = 2 oldselect(1024, [18], [], [], {0, 0}) = 0 (Timeout) oldselect(1024, [18], [], [], {0, 0}) = 0 (Timeout) so something is timing out on its IO, which I guess is taking up all the time. So my question now is, whats it timeing out on and why? There is nothing of interest in any system logs, and disk access has never been a problem. The full strace is at http://www.fractalus.com/steve/tmp/tmp2.bz2 (450k) I accept my comments on storing up a table of images is wrong, but I would be interested in seeing it not doing that. Granted large tables of images should be wrung through the Gimp or ImageMagick. have fun, SteveC steve at fractalus.com fractalus.com/steve