Hello,
there is no "new" -debug, its the same, nothing changed in the behavior. -debug can be used with all versions.
Normal compiler = Compile.WIN - Release.bat ?
Only thing changed is the removal of /optimize when Debug is used to align compile behavior/options with visual studio, so outcome of VS Debug is the same as with CSC Debug.
However lets investigate this...
EDIT: Forgot to mention that -debug is completely unrelated to "compiling" with debug.
[doublepost=1518511161][/doublepost]Hello,
I can reproduce this,
So to cleanup with confusion:
-debug triggers the "debug" variable in Server (and Scripts) setting it to true. If scripts/server have exented output they will do this no matter how you compile.
Compiling with Debug adds overhead allowing you to debug the server while running. You can attach Visual Studio or IDA or whatever and debug it on runtime seeing the actual code, with the additional compiled PDB File (which is only added in Debug Builds)
In the past Visual Studio Projectfiles where configured using Debug as intended. The BAT File uses Debug BUT addtionally uses
optimize. Optimize will render using Debug (which adds overhead anyways) partly useless. So using optimize in combination with debug...you're better-off using release.
Conclusion:
Stick with Compile.WIN - Release.bat for production use (as mentioned in the readme), you can add -debug for extended output of scripts and server. Compile.WIN - Debug.bat is really for development as stated in the readme. You can attach a debugger what isn't or partly possible with Release builds.
"When the compiler optimizes code, it repositions and reorganizes instructions. This results in more efficient compiled code. Because of this rearrangement, the debugger cannot always identify the source code that corresponds to a set of instructions."
Source:
https://technet.microsoft.com/library/606cbtzs(v=vs.120).aspx
So right now we can better track error and performance regressions because it doesn't matter if you compile it with VS or CSC anymore as options now lineup. This hasn't been the case before. Release or Debug can be tracked in the first output of servuo.
PAST:
Visual Studio:
Release -> release, optimize (no overhead)
Debug -> debug
Compile.bat:
Release -> not available
Debug -> debug, optimize
NOW:
Visual Studio:
Release -> release, optimize (no overhead)
Debug -> debug
Compile.bat:
Visual Studio:
Release -> release, optimize (no overhead)
Debug -> debug
EDIT: My Worldsave timings:
release: 0.2-0.3
debug with optimize: 0.3-0.4
debug: 0.5-0.6
EDIT: ScriptCompiler.cs
Even here
https://github.com/ServUO/ServUO/blob/master/Server/ScriptCompiler.cs it only adds /optimize if not in -debug mode. So this was all mixed up.