Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Mata slow?


From   Brendan Halpin <brendan.halpin@ul.ie>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Mata slow?
Date   Tue, 28 Nov 2006 23:17:16 +0000

wgould@stata.com (William Gould, Stata) writes:

> Brendan Halpin <brendan.halpin@ul.ie> explained that the Mata code we have
> been discussing is to be called _N*(_N-1)/2 times, so speed is important.
>
> To refresh your memories, Brendan wrote code that ran in .03906 seconds, 
> which he noted was about 40 times slower than a plugin he wrote in C.
> I worked on the code on got the execution time down to .0228 seconds, 
> or about 22 times slower than the plugin.
>
> Motivated by Brendan's latest comment, I have now improved the program so that
> it runs in .003 seconds.  That's just 2 times slower than the plugin, and we
> have reduced the run time to just 7.5% of the original.

Many thanks for that! It really makes a difference. 

Brendan
-- 
Brendan Halpin,  Department of Sociology,  University of Limerick,  Ireland
Tel: w +353-61-213147 f +353-61-202569 h +353-61-338562; Room F2-025 x 3147
mailto:brendan.halpin@ul.ie  http://www.ul.ie/sociology/brendan.halpin.html
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index