[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Is it possible to 'precompile' a module in one luaState and quicklymove it over to another? (keywords multiple interpreters, precompile)
- From: "Peter Pimley" <Peter.Pimley@...>
- Date: Mon, 12 May 2008 18:53:32 +0100
Hi,
In the next few days I'm going to be in a similar situation.
It would be interesting to measure how much of that 0.5s is taken
actually opening the file. That's not including reading from it, and
not including the work of interpreting it. It might surprise you. Are
you on a platform where file opening or seeking time is a problem? If
you happen to be using cygwin, I think opening a file is quite a bit
more expensive than the native call.
You could test this by making the module contain no code whatsoever (but
still be a file on disk) and carrying out your timing again.
If that is where your bottleneck lies then you could hold the module in
memory in your C application (i.e. as a const char *). Then tweak the
"require" code to look there as well. I forget exactly how it's done,
but I'm sure it's possible.
Peter Pimley
__________________________________________________________________________________________________________________________________________
Information contained in this e-mail is intended for the use of the addressee only, and is confidential and may be the subject of Legal Professional Privilege. Any dissemination, distribution, copying or use of this communication without prior permission of the addressee is strictly prohibited.The views of the author may not necessarily constitute the views of Kuju Entertainment Ltd. Nothing in this email shall bind Kuju Entertainment Ltd in any contract or obligation.
The contents of an attachment to this e-mail may contain software viruses which could damage your own computer system. While Kuju Entertainment has taken every reasonable precaution to minimise this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should carry out your own virus checks before opening the attachment.
Kuju Entertainment Ltd trading as Zoe Mode
Registered Office : 185 Park Street, Bankside, London, SE19DY. Company Number : 3481384.Company Registered in England.
__________________________________________________________________________________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
_________________________________________________________________________________________________________________________________________