Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: inline mata vs mo/mlib?


From   Roger Newson <roger.newson@kcl.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: inline mata vs mo/mlib?
Date   Wed, 10 Aug 2005 12:39:45 +0100

At 11:40 10/08/2005, Kit wrote:
A SSC contributor has raised an interesting question. Say that you
have an ado-file that calls one (or several) of your own mata
functions. You could place those functions in-line in the ado-file,
or you could compile them into .mo and put them into an .mlib.

is there any real downside to distributing a single ado-file
containing the mata functions inline versus distributing the .ado
and .mlib (and presumably the .mata if you want to expose the code)?
The inline code will be compiled when loaded, but once per session.
Presumably the downside is the time taken to compile the Mata functions every time the .ado is called (or, as you say, every session in which the .ado is called at least once). I don't know how "real" this problem is, or how large a Mata library has to be before it gets "real". I personally have used the .mlib solution up until now (plus the .mata files to keep it open source), but am open to persuasion otherwise, if anybody knows anything I don't.

Roger



--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
Division of Asthma, Allergy and Lung Biology
King's College London

5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: roger.newson@kcl.ac.uk
Website: http://phs.kcl.ac.uk/rogernewson/

Opinions expressed are those of the author, not the institution.

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