octave-maintainers
[Top][All Lists]
Advanced

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

Re: slow char({str})


From: Daniel J Sebald
Subject: Re: slow char({str})
Date: Wed, 24 Jun 2009 01:34:51 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

Jaroslav Hajek wrote:

Please check
http://hg.savannah.gnu.org/hgweb/octave/rev/4ff6f8efdda2

also transplanted into 3.2.x.

thanks

Very nice Jaroslav.  Which of these changes is the speedup coming from?
This hunk

-       elem (i, j) = s[i][j];
+       elem (i, j) = si[j];

shouldn't have been too much as there is only a little extra computation in
the indexing before the change.


No. In fact, this *was* the bottleneck, changing a linear complexity
operation to quadratic one. Welcome to the world of COW magic.

Oh yeah, s is a reference, not a pointer...

What does COW stand for, other than can of worms?

Dan


reply via email to

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