Difference between revisions of "Creating Multithreaded Skyrim Mods"

Jump to navigation Jump to search
no edit summary
imported>Chesko
imported>Chesko
Line 34: Line 34:
Only profiling your scripts by using one of the various profiling functions can tell you whether or not these patterns will improve your mod's behavior. I have personally seen performance over 10 times faster (an action that once took ~8.5 seconds to now takes ~0.5 seconds) in my own mods using this method.
Only profiling your scripts by using one of the various profiling functions can tell you whether or not these patterns will improve your mod's behavior. I have personally seen performance over 10 times faster (an action that once took ~8.5 seconds to now takes ~0.5 seconds) in my own mods using this method.


Note that by spinning up many threads simultaneously, you are invariably placing increased load on the Papyrus VM. You must decide whether or not the narrow "spike" of resource consumption using threads is better than the more spread-out "swell" of a single thread calling many functions back-to-back. Again, '''profile''' before and after!
Note that by spinning up many threads simultaneously, you are invariably placing increased load on the Papyrus VM for as long as it takes your threads to complete. Ideally, this should be a much shorter frame of time than if the task were done in a single thread. You must decide whether or not the narrow "spike" of resource consumption using threads is better than the more spread-out "swell" of a single thread calling many functions back-to-back. Again, '''profile''' before and after!


{{WarningBox|Keep in mind that asynchronous operations means that you don't know how fast, or in what order, your threads will run or finish.
{{WarningBox|Keep in mind that asynchronous operations means that you don't know how fast, or in what order, your threads will run or finish.
Anonymous user

Navigation menu