Subj : Re: Performance? To : Rickard From : Igor Bukanov Date : Sun Jun 22 2003 02:15 am Rickard wrote: > Igor Bukanov wrote: > >>> But, these scripts will run over and over again. Isn't it better to >>> have them compiled in that case? >> >> >> How do you execute the script now? Do you use Context.compileScript() >> and call Script.exec() later or call Context.evaluateString directly >> which just a convenience method to call the above sequence? > > > I call compileScript() once and exec() them later on (I have a hashmap > cache with the script String as key and the compiled script as value). You did it right. With this setup running Script.exec with the optimization levels >= 0 should indeed be faster, so the slow down should be in the nature of your scripts. Could you provide an example? Regards, Igor .