Wireshark-dev: [Wireshark-dev] Windows Wireshark being compiled w/o any optimization ??
From: Bill Meier <wmeier@xxxxxxxxxxx>
Date: Wed, 11 Jan 2012 14:12:47 -0500
I was curious about the code being being generated by the Windows compiler for the g_?to? macros so I used the /FAs option to generate a listing which contained the assembly code for one of the dissectors.

Upon examining the code, I found it to be rather inefficient.

Upon poking around a bit, much to my surprise I found that it appears that Wireshark is being compiled on Windows without any optimization.

After I recompiled the dissector using the /O2 ("optimize for fastest code in majority of cases") I found that the generated code was significantly better.

According to Microsoft, when using the Visual Studio Development Environment, /O2 is "the default setting for release builds" so this sounds like what we should be using when we build using nmake.

Is there some history as to why there's no optimization (at least for releases) ??

(I'm assuming there's nothing special going on [with respect to optimization] to create a release).

AFAIKT, No /O option has ever been specified in config.nmake

-------------

Rebuilding Wireshark with /O2 I found:

1. packet-parlay.c took a long time (5 mins ?) to compile
   but otherwise the compilation time seemed to be OK.

2. The size of the .exes plus the Wireshark dll's (libwireshark.dll, etc) was reduced by about 15-20 %.

3. The size of the .obj files was much larger for some reason.


I didn't do any performance testing.