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   William Buchanan <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: regexr string function very slow in Stata13
Date   Fri, 13 Dec 2013 05:15:20 -0600

Are you using the same flavor of Stata across the two versions?  I regularly need to use regular expressions to clean up strings and haven't noticed any differences between MP versions, but did notice speed differences between v 12MP2 and v 13SE.

Sent from my iPhone

> On Dec 13, 2013, at 4:28, Nick Cox <[email protected]> wrote:
> 
> Depends what the question is, really. But you're showing that Stata 13
> is slower at the same job than Stata 12. That's, I guess, an undesired
> side-effect of rewriting string functions to cope with long strings,
> even if you don't have long strings.
> Nick
> [email protected]
> 
> 
>> On 13 December 2013 10:20, Nicola Tommasi <[email protected]> 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/
> *
> *   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/

*
*   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