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

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

[Octave-patch-tracker] [patch #8066] speedup of strjoin


From: anonymous
Subject: [Octave-patch-tracker] [patch #8066] speedup of strjoin
Date: Tue, 04 Jun 2013 17:51:28 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0

URL:
  <http://savannah.gnu.org/patch/?8066>

                 Summary: speedup of strjoin
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Di 04 Jun 2013 17:51:27 UTC
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:



> % short string, many cells
> a = {'a'};
> b=repmat(a,1,1e5);
> tic
> c1=strjoin(b);
> toc
Elapsed time is 0.363541 seconds.

> tic
> c2=[[b(:).' ; repmat({' '},1,numel(b))]{:}](1:end-1);
> toc
Elapsed time is 0.3507609 seconds.


> % long string, less cells
> a={repmat('a',1,1e5)};
> b=repmat(a,1,1e3);
> tic
> c1=strjoin(b);
> toc
Elapsed time is 1.692134 seconds.

> tic
> c2=[[b(:).' ; repmat({' '},1,numel(b))]{:}](1:end-1);
> toc
Elapsed time is 0.2909841537 seconds.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Di 04 Jun 2013 17:51:27 UTC  Name: strjoin.patch  Size: 601B   By: None

<http://savannah.gnu.org/patch/download.php?file_id=28264>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?8066>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

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