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: stata 13 runs slower than stata 12


From   Alan Riley <ariley@stata.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: stata 13 runs slower than stata 12
Date   Wed, 4 Sep 2013 14:57:50 -0500

LU Heng <luheng9@gmail.com> asked about the speed of the -char()-
function in Stata 13 vs. Stata 12:
> I'm using stata/se 13 on a 32bit Windows machine now. I find that stata 13
> runs much slower than stata 12. 
> It took a very long time (longer than a half day) to run the following
> syntax using stata/se 13:
> 
> foreach var of varlist v1- v50 {
> quietly replace `var'="41" if `var'==char(41)
> quietly replace `var'="42" if `var'==char(42)
> quietly replace `var'="43" if `var'==char(43)
> quietly replace `var'="44" if `var'==char(44)
> quietly replace `var'="45" if `var'==char(45)
> quietly replace `var'="46" if `var'==char(46)
> quietly replace `var'="47" if `var'==char(47)
> quietly replace `var'="48" if `var'==char(48)
> quietly replace `var'="49" if `var'==char(49)
> quietly replace `var'="50" if `var'==char(50)
> }
> 
> However, when I run the above syntax using stata/se 12 on the same machine,
> it took much less time (several minutes). 
> Do you have any idea about this? Does anyone have similar experiences?

We are unable to reproduce a drastic decrease in speed such as
Lu described.  On a dataset with 50 variables and 1 million
observations, Lu's code runs in 25 seconds on Stata 13 and
21 seconds on Stata 12.

The reason for that slight difference is there is a little bit of extra
work being done on behalf of string functions due to the new long string
(strL) support in Stata 13, and the -char()- function itself has been
slightly modified to allow for the possibility of binary 0 (char(0)).

Lu should send information about his dataset and his timings
to our technical services department at tech_support@stata.com,
and they will be happy to help him diagnose what is happening
on his system.


Alan
ariley@stata.com

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