octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #39430] regexp: performance for cell arrays is


From: Rik
Subject: [Octave-bug-tracker] [bug #39430] regexp: performance for cell arrays is slow
Date: Sun, 07 Jul 2013 23:55:03 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0

URL:
  <http://savannah.gnu.org/bugs/?39430>

                 Summary: regexp: performance for cell arrays is slow
                 Project: GNU Octave
            Submitted by: rik5
            Submitted on: Sun 07 Jul 2013 04:55:02 PM PDT
                Category: Libraries
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Performance
                  Status: Confirmed
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

The performance of regexp is an order of magnitude slower than the same
functionality in strfind.  Some performance penalty is expected, but not this
great.

Sample Code:



octave:71> xc = cellstr (char (randi( [65 65+25], [1e5, 20])));
octave:72> tic; yr = regexp (xc, 'ABC'); toc
Elapsed time is 2.5726881 seconds.
octave:73> tic; y = strfind (xc, 'ABC'); toc
Elapsed time is 0.20126295 seconds.


There seem to be several causes.  It appears that Octave is re-compiling the
PCRE pattern every time it does a match for one row.  Octave is also bothering
to process and restore all possible return values (start, end, tokens,
tokenextents, match, and splits) even if only a subsection is desired.  I
haven't done a hotspot analysis though.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39430>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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