Maybe what you need is background compilation/preparation, which could reduce initial execution by going straight to JIT'd code without having to wait for compilation.
On Fri, May 14, 2010 at 10:46 PM, Martin Smith <martin.smith...@gmail.com>wrote: > Hi Tomas, > > So all of the dialogs in our application are built using IR. The first > time any dialog is used there's probably a second or two delay, then > there's probably a half second (or maybe a bit less) delay each time a > new dialog is required for the first time. I've thought about doing > all of this on a secondary thread at startup, but that would require > "unwinding" our code a bit. Presumably we could just require all the > dialog ruby code when we fire up the app. This would probably work > and would potentially take a few seconds. > > Right now, our application is deployed via mono on the mac, so we're > using the .net 2.0 sp1 binaries and they're just sitting there > alongside our binaries. We're still deciding about whether we'll go > with .NET 2.0 sp1 or .NET 4 for our next PC version and will use the > IR binary for the framework version we decide on. I would say we're > not "requiring" (in the ruby sense of the word) anything too exotic, > just a bunch of ruby files at runtime. We use a small subset of the > standard library. > > Do you know what happens if I change the compilation threshold while > running, btw? > > Seriously, i cant thank you guys enough for the great work you do. > Martin > > On Wed, May 12, 2010 at 1:00 PM, Tomas Matousek > <tomas.matou...@microsoft.com> wrote: > > How long does it take to require all the files you need? Do you use > installed IronRuby v1.0 binaries for .NET 4.0 or do you build IronRuby > yourself? > > Can you be specific about what you're requiring? > > > > Tomas > > > > -----Original Message----- > > From: ironruby-core-boun...@rubyforge.org [mailto: > ironruby-core-boun...@rubyforge.org] On Behalf Of Martin Smith > > Sent: Wednesday, May 12, 2010 11:27 AM > > To: ironruby-core@rubyforge.org > > Subject: Re: [Ironruby-core] What's next? > > > > You guys have hit the nail on the head for me I actually want it for both > reasons: to provide some loose protection for our code and to improve > startup times. > > > > I was thinking about doing something around packaging like you guys were > talking about, but i think then I'd have to redefine Kernel.require to make > sure that all the require statements execute properly. For code protection, > it only provided small benefits (a determined code stealer would easily > circumvent the protections), but if it helped with startup times that would > benefit us greatly. > > > > The issue is that we use IR for our UI layer so the first time they ask > for any dialog it needs to compile quite a bit of code so the first time > they load a dialog can take some time. I've thought of changing this so we > do the compilation at startup but i'm not quite sure if that will work. I'd > envision something like this: > > > > 1) set compilation threshold to 0 (compile immediately) > > 2) execute "require 'file'" for each ruby script > > 3)set compilation threshold to 1 so eval doesn't compile everything (we > semi-extensively use eval) > > > > Would something like this be possible? Is the compilation threshold > settable dynamically? > > > > Thanks in advance, > > Martin > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core@rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core@rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core@rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >
_______________________________________________ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core