octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: __scatter__.m: Fix handling of NaNs in marker size param


From: Rik
Subject: Re: __scatter__.m: Fix handling of NaNs in marker size param
Date: Wed, 11 Sep 2013 05:20:22 -0700

On 09/11/2013 03:48 AM, address@hidden wrote:
> Message: 5
> Date: Wed, 11 Sep 2013 10:43:44 +0200
> From: Andreas Weber <address@hidden>
> To: Jordi Guti?rrez Hermoso <address@hidden>
> Cc: Octave Maintainers List <address@hidden>
> Subject: Re: __scatter__.m: Fix handling of NaNs in marker size param
> Message-ID: <address@hidden>
> Content-Type: text/plain; charset="utf-8"
>
> On 10.09.2013 20:57, Jordi Guti?rrez Hermoso wrote:
>> > On Tue, 2013-09-10 at 20:22 +0200, Andreas Weber wrote:
>>> >> Can I push the attached patch which should fix this or am I missing
>>> >> something?
>> > ...
>> > Remember, no spaces before parens when indexing, only when calling
>> > functions.
> Yeah, I made a copy & paste from "x (idx) = [];"
> Riks change from yesterday "5e552cd9315a: Overhaul scatter family of
> functions" fixed this(amongst others). I therefore had to rewrite my
> patch which is attached.
>
>> > I happen to like the |= operator, but ignore this point if
>> > you find it obscure.
> I like them too but thought someone else might find it obscure :-D
9/11/13

Andy,

It happened to be a random coincidence that I went in and cleaned up the
scatter functions yesterday.  Your change looks sensible to me.

Also, the in-place operators are great for performance and we are allowed
to trade obscurity for performance in core Octave.

Here's a benchmark that I just worked up:

octave:1> x1 = logical (randi ([0 1], 1e4,1));
octave:2> x2 = x1;
octave:3> y = logical (randi ([0 1], 1e4,1));
octave:4> tic; x1 = x1 | y; toc
Elapsed time is 0.00010705 seconds.
octave:5> tic; x2 |= y; toc
Elapsed time is 7.10487e-05 seconds.

So, a 34% improvement which is a Good Thing (TM).

Cheers,
Rik



reply via email to

[Prev in Thread] Current Thread [Next in Thread]