|
From: Dmitri A. S. <das...@gm...> - 2006-08-07 05:07:22
|
On 8/6/06, Ethan A Merritt <merritt@u.washington.edu> wrote:
> > It is an issue, because previously I did not bother to check
> > if NaNs in my files written as "NaN" or as "nan".
>
> gnuplot reads the number using strtod().
> The linux man page for strtod() says:
>
> An infinity is either ``INF'' or ``INFINITY'', disregarding case.
> A NAN is ``NAN'' (disregarding case) optionally followed by `(', a
> sequence of characters, followed by ')'. The character string speci-
> fies in an implementation-dependent way the type of NAN.
Here is the data file ("t3.dat"):
# -- begin
0 2
2 0
NaN NaN
4 2
2 4
# -- end
with gnuplot 4.1 (today's CVS snapshot):
gnuplot> plot "t3.dat"
^
Bad data on line 3
gnuplot> set datafile missing "NaN"
gnuplot> plot "t3.dat"
gnuplot>
(gnuplot 4.0 just plots it)
> That's a bit hard to believe.
>
> How big are your data files?
For the benchamrk I made 2 column data file
x = (-10,10), y = sin(x)
with 1e6 (one million) rows.
cmd is just a one line script
first it is:
plot "t.dat"
[dima@das200 tmp]$ time gnuplot < cmd
real 0m3.814s
user 0m3.488s
sys 0m0.152s
Now changed it to
plot "t.dat" using 1:2
[dima@das200 tmp]$ time gnuplot < cmd
real 0m3.831s
user 0m3.528s
sys 0m0.176s
And finally changed it to
plot "t.dat" using ($1):($2)
[dima@das200 tmp]$ time gnuplot < cmd
real 0m11.086s
user 0m5.828s
sys 0m4.600s
So the wall clock actually increased by factor of 4 mostly due to
"sys" time (originally I just looked at user time -- that is where 150%
came from). I tried both X11 terminal and "dumb" (and output to
/dev/null) w/o any noticeable difference. These numbers do not
include time of
gnuplot_x11 doing actual drawing.
I did multiple passes, so I am pretty sure the data file is in disk cache.
All this is on FedoraCore 5/ Pentiun4 2.6GHz / 2GB of RAM
>
> EAM
>
Sincerely,
Dmitri.
--
|