Papyrus compiler -optimize option: experiences?

Post » Tue Jul 29, 2014 3:57 pm

Just a quick query: the Papyrus compiler has a -optimize option: Is the general practice to enable this option? Are there any known downsides to doing this? I did a search on the forums but could not find the answers here.

Cheers,

Snotgurg

User avatar
Lillian Cawfield
 
Posts: 3387
Joined: Thu Nov 30, 2006 6:22 pm

Post » Tue Jul 29, 2014 4:16 pm

Unfortunately, I've forgotten the details, but I ran into some problems with it in the past (either it rejected otherwise valid input, or it generated broken code; I'm pretty sure it was the former).

Plus, I'd say that optimizing Papyrus on bytecode level is generally not worth it. The most important performance consideration is structuring your script and writing your code to keep the number of external calls at a minimum (see http://www.creationkit.com/Threading_Notes_(Papyrus).
User avatar
Laura Ellaby
 
Posts: 3355
Joined: Sun Jul 02, 2006 9:59 am

Post » Wed Jul 30, 2014 1:47 am

Ok, thanks. With respect to it being worth it: flipping on a switch seems like little trouble for any gains. Given everything works of course :-) Completely agree with optimizing the script code itself though.

One concrete thing I would really like to know is whether the compiler/run-time of Papyrus can optimize tail-recursive calls. I'm now hesitant to implement recursive calls, but if such optimization would be done, it might be a nice option to have.

User avatar
Tiffany Carter
 
Posts: 3454
Joined: Wed Jul 19, 2006 4:05 am


Return to V - Skyrim