bugGNU Octave - Bugs: bug #40613, exist(..., 'var') slow when...

 
 

bug #40613: exist(..., 'var') slow when variable does not exist

Submitted by:  None
Submitted on:  Sun 17 Nov 2013 11:10:48 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Performance
Status: FixedAssigned to: John W. Eaton <jwe>
Originator Name: ChristianOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.2.4
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 20 Nov 2013 06:02:54 PM UTC, comment #5:

Tested and fixed. Closing report.

Rik <rik5>
Project Administrator
Wed 20 Nov 2013 04:30:39 PM UTC, comment #4:

I checked in the following change:

http://hg.savannah.gnu.org/hgweb/octave/rev/2ca3a2f46d93

It seems to fix the problem for me. If someone else confirms that it is fixed, please close this report.

Sorry about forgetting to put the bug ID in the commit message. It would be great to be able to edit those...

John W. Eaton <jwe>
Project AdministratorIn charge of this item.
Mon 18 Nov 2013 01:55:47 AM UTC, comment #3:

I'll take a look at fixing this one.

John W. Eaton <jwe>
Project AdministratorIn charge of this item.
Mon 18 Nov 2013 01:41:17 AM UTC, comment #2:

I think this is down to the implementation. When looking at the code, it appears octave is looking for the symbol named NAME, then check that the symbol found is of type TYPE. In that regard, supplying the type argument does not offer any speedup.

Because a symbol can be many different things, when a symbol does not exist as a variable, octave will try hard to find the matching symbol: functions, methods... and if nothing is found, it'll refresh path and start again.

Michael Goffioul <goffioul>
Project Member
Sun 17 Nov 2013 11:59:19 PM UTC, comment #1:

Surprisingly this slowdown is still present on the development branch. One doesn't even need the for loop to see that the slowdown is ~75X.

Marking bug as confirmed.

Rik <rik5>
Project Administrator
Sun 17 Nov 2013 11:10:48 PM UTC, original submission:

Hi,
Don't know if this is already known and fixed, but using 'exist()' to check existance of a non-existing variable takes a very long time. See code below:

/Christian

PS. Corresponding code on MATLAB 2012b is pretty much instantaneous in both cases.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by goffioul (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 20 Nov 2013 06:03:26 PM UTCrik5Open/ClosedOpen=>Closed
    Wed 20 Nov 2013 06:02:54 PM UTCrik5StatusReady For Test=>Fixed
    Wed 20 Nov 2013 04:30:39 PM UTCjweStatusConfirmed=>Ready For Test
    Mon 18 Nov 2013 01:55:47 AM UTCjweAssigned toNone=>jwe
    Sun 17 Nov 2013 11:59:19 PM UTCrik5StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1