octave-maintainers
[Top][All Lists]
Advanced

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

Re: assert () taking long time


From: Daniel Kraft
Subject: Re: assert () taking long time
Date: Tue, 24 Sep 2013 07:23:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

Hi Rik,

On 2013-09-23 23:31, Rik wrote:
> I just checked in a changeset which avoids pre-calculating the error
> message which may never get used (~16% speed-up).  I also did a little
> profiling and changed a repmat construction to a const*ones(...) (~23%
> speed-up).  So, overall maybe a 33% improvement.  I think if you want to
> substitute a much simpler, albeit faster, version of assert you should make
> it a local change.  The assert.m in Octave needs to stay general and able
> to work for simple logical expressions, numeric comparisons, on up to
> recursive comparison of cell arrays and structures.  Perhaps the easiest
> thing would be to rename your function to qassert.m (Quick Assert) and then
> find and replace all instances of assert in your code with qassert.

thanks for your work here, it is very much appreciated!  A faster
assert() will surely help me and others in general, but for my current
application, I think I'll then stick with a local version of assert.m.
I personally usually use assert() only with conditions and maybe with
numerical values, but not the "advanced" versions with structs or
cell-arrays.  Thus I'll use my own, simplified version when speed is
critical as you suggest.

Yours,
Daniel

-- 
http://www.domob.eu/
--
Done:  Arc-Bar-Cav-Hea-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Mon-Pri


reply via email to

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