This project has moved and is read-only. For the latest updates, please go here.

Pre-compiling Javascript

Sep 4, 2012 at 8:35 AM

Can we pre-compile javascript? If so how can we do that. I need to pre-compile javascript so that I can use it later for some logic like rearraning different compiled code for exetuing it etc. ). Thanks in advance for the help.

Sep 4, 2012 at 11:20 PM

If you mean, "can you compile some javascript, then call it repeatedly without compiling it every time", then yes, you can!  See

If you mean, "can you compile some javascript, then save it to disk as a DLL", then no, though a few people have modified Jurassic to enable this.  See and

Sep 5, 2012 at 9:46 AM

hey thanks a lot paulbartrum. It works as I need.  :-)

Sep 5, 2012 at 11:42 AM
Edited Sep 5, 2012 at 11:43 AM

I have one more issiue now. Though precompiling takes half the time than the other way, it is still slow as compared to Rhino used for Java. For Java using Rhino we can process 1 lakh JS records in 500 milliseconds and for .Net using Jurassic it takes 289 milliseconds to process only 1000 JS records. Is there any other way to fasten the process of compilation of Javascript? Appreciate the help.

Sep 5, 2012 at 11:26 PM

If you post your code I'll take a look, see if I can speed it up.