Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: regexr string function very slow in Stata13


From   Richard Williams <richardwilliams.ndu@gmail.com>
To   statalist@hsphsun2.harvard.edu, statalist@hsphsun2.harvard.edu
Subject   Re: st: regexr string function very slow in Stata13
Date   Fri, 13 Dec 2013 08:05:03 -0500

Something similar came up a few months ago:

http://www.stata.com/statalist/archive/2013-09/msg00190.html

I would check to make sure you have the most up to date version of Stata 13.1; if there was a bug it may have been fixed.

At 05:20 AM 12/13/2013, Nicola Tommasi wrote:
Hi all
On my computer they are installed Stata12 and Stata13, but regexr function run very slowly in Stata13. Here a log file
Any idea?



. count;
730649

. di "`c(stata_version)' - `c(os)' - `c(osdtl)' - `c(machine_type)' - `c(processors)'";
13.1 - Windows - 64-bit - PC (64-bit x86-64) - 4

. timer on 1;

. gen var2 = regexr(var1,"<[^<>]+>","");

. timer off 1;

. timer list 1;
   1:     54.88 /        1 =      54.8830

. timer on 2;

. replace var2 = regexr(var2,"<[^<>]+>","");
(730649 real changes made)

. timer off 2;

. timer list 2;
   2:     54.14 /        1 =      54.1400





. count;
730649

. di "`c(stata_version)' - `c(os)' - `c(osdtl)' - `c(machine_type)' - `c(processors)'";
12.1 - Windows - 64-bit - PC (64-bit x86-64) - 4

. timer on 1;

. gen var2 = regexr(var1,"<[^<>]+>","");

. timer off 1;

. timer list 1;
   1:      1.43 /        1 =       1.4300

. timer on 2;

. replace var2 = regexr(var2,"<[^<>]+>","");
(730649 real changes made)

. timer off 2;

. timer list 2;
   2:      0.49 /        1 =       0.4860




--
_______________________________________________________________________
dott. Nicola Tommasi
Centro Interdipartimentale di Documentazione Economica (C.I.D.E)
University of Verona
via dell'Artigliere, 19
37129 Verona (Italy)
tel.: +39-045-8028048
fax.: +39-045-8028047
Skype: nicola.tommasi
________________________________________________________________________

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  Richard.A.Williams.5@ND.Edu
WWW:    http://www.nd.edu/~rwilliam

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index