octave-maintainers
[Top][All Lists]
Advanced

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

FYI: sparse indexed assignment rewritten


From: John W. Eaton
Subject: FYI: sparse indexed assignment rewritten
Date: Wed, 14 Apr 2010 09:44:52 -0400

On 13-Apr-2010, Jaroslav Hajek wrote:

| I've nearly finished rewriting the sparse indexed assignment code.
| The old incomprehensible quirky implementation is replaced by a shiny
| new incomprehensible quirky implementation :)
| Well at least I tried to comment more. And the code went down from
| 1100 to 330 lines.

Thanks for working on this big job.

| 2. concatenation doesn't use the new assignment & preallocation
| mechanism, leading to some ridiculous results:
| 
| [...]
| 
| produces this:
| 
| approach 1: built-in concatenation
| Elapsed time is 13.6298 seconds.
| approach 2: hand-coded loop
| Elapsed time is 0.0499048 seconds.
| 
| i.e. a built-in operation is 270-times slower than an equivalent
| interpreted loop (and you thought loops were sluggish? :).
| It would be cool if sparse concatenation could take advantage of the
| new speed-ups, but it needs some work. Help is much appreciated.

Ouch, but I'm sure this can be improved.

| 3. simple grep query shows that the interpreter uses nzmax at
| suspiciously many places. I bet some of those usages are wrong and
| should be nnz, but it requires individual approach. So get ready for
| mysterious crashes, just in case.

I guess we need to look at all nzmax uses and decide whether they
should be nnz instead.  Are there any simple rules for when nzmax is
required?

| PS. I feel exhausted today. I'm wondering what heros wrote all that
| GNU and other free software I use on daily basis, because although it
| is fun it to improve Octave it also costs me lots of time and
| energy.

Well, it wasn't written in a day, or by just one person...

| I might need to play less with Octave and focus more on publications
| to earn my bread. The country is short of money, and those who dabble
| in science are going to feel it next year. If only each contribution
| was a publication, and each use was a citation :)

I hope you will still have some time for Octave.  You've made a lot of
really amazing contributions over the last two years.

jwe


reply via email to

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