Difference between revisions of "Talk:Minimizing your Script"

Jump to navigation Jump to search
1,239 bytes added ,  06:34, 10 August 2009
imported>DragoonWraith
imported>Sabar
Line 28: Line 28:
::I completely agree with you, but I'd really like some other opinions from experienced scripters. I've always been very much in favor of scripting (and modding) primarily for myself, so performance concerns beyond "does it run on my machine" have never been an issue for me. At the same time, I've read (and participated in) the tests, and I have a pretty good idea of what are performance issues and what are not - and scripts almost ''never'' are. As you say, the advice here confuses code and involves scripting that is confusing and obtuse - and I guarantee you, that in almost all cases, the performance gain is perfectly ''negligible''. Even if said script was running on a thousand objects concurrently, for most scripts I doubt you'd see a difference in FPS at all.
::I completely agree with you, but I'd really like some other opinions from experienced scripters. I've always been very much in favor of scripting (and modding) primarily for myself, so performance concerns beyond "does it run on my machine" have never been an issue for me. At the same time, I've read (and participated in) the tests, and I have a pretty good idea of what are performance issues and what are not - and scripts almost ''never'' are. As you say, the advice here confuses code and involves scripting that is confusing and obtuse - and I guarantee you, that in almost all cases, the performance gain is perfectly ''negligible''. Even if said script was running on a thousand objects concurrently, for most scripts I doubt you'd see a difference in FPS at all.
::[[User:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">D</span>ragoon <span style="font-family: Oblivion, Daedric Runes; size=2;">W</span>raith]] [[User_talk:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">TALK</span>]] 16:41, 14 May 2009 (EDT)
::[[User:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">D</span>ragoon <span style="font-family: Oblivion, Daedric Runes; size=2;">W</span>raith]] [[User_talk:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">TALK</span>]] 16:41, 14 May 2009 (EDT)
:::The page needs to be changed.  The most likely situations that are going to effect FPS through high CPU usage are doing things with a high amount of complexity (i.e. algorithm with n^2 worst case) or doing something silly (iterating through hundreds of references per frame, infinite loops, etc).  All of these cases when improved would offer a dramatic CPU decrease.  The tiny effect of scripts on FPS can be seen by making small programs in a language such as C and timing them.  One will quickly realize that the improvements suggested in the article improve script speed linearly and on an order of magnitude in nanoseconds.  Even running the code for many iterations and summing the saved time would yield only milliseconds of gained time at best.  The problem with scripting and FPS is algorithm complexity.  If your fancy OBSE script is making n^2 comparisons a frame, you can gain much more by using something that works in linear or logarithmic time instead of saving the CPU 3 clock cycles by early returning or not using a conditional.  Note that a modern CPU can decode multiple instructions per clock cycle at well over 3 billion cycles per second. I say redo the article. [[User:Sabar|Sabar]] 07:34, 10 August 2009 (EDT)
Anonymous user

Navigation menu