Optimizing DLLs: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(small typo fix)
m (fix)
Line 1: Line 1:
The default release mode that comes with the source SDK Visual Studios Projects is all right for many mods, but it can be better, and run faster with some small changes. In the project properties page of your client and server, change these settings to get faster DLL-files.
The default release mode that comes with the Source SDK's Visual Studios Projects is acceptable for many mods, but it can be made better and faster with some small changes.


In the project properties page of your client and server, change these settings to optimize your DLL files.


''General''
#''General''<br>Whole Program Optimization 'yes'{{note|Memory requirements can be very high when compiling with ''Whole Program Optimization'' on}}
* Whole Program Optimization 'yes'
#''C/C++ add these two switches to the 'command line''':<br>/GL /G7
{{note|Memory requirements can be very high when compiling with ''Whole Program Optimization'' on}}
#''Link add these three switches to the 'command line''':<br>/OPT:ICF /OPT:WIN98 /LTCG{{note|You should only need to use /LTCG if you built the vgui_controls.lib with the fixes.}}


 
It will take longer for it to link the code, but it will run faster than with the default settings.
''C/C++ add these two switches to the 'command line'''
* /GL /G7
 
 
''Link add these three switches to the 'command line'''
* /OPT:ICF /OPT:WIN98 /LTCG
 
 
It will take longer for it tot link the code, but it will run faster then with the default release mode.
 
{{note|You should only need to use /LTCG if you built the vgui_controls.lib with the fixes.}}


You can also enable SSE (Streaming SIMD Extensions) optimizations due to the minium requirements of HL2 being a 1.2 GHz CPU, that defaults to a Pentium 4, or AMD Athlon that support this technology. This can be found under the ''Code Generation''.
You can also enable SSE (Streaming SIMD Extensions) optimizations due to the minium requirements of HL2 being a 1.2 GHz CPU, that defaults to a Pentium 4, or AMD Athlon that support this technology. This can be found under the ''Code Generation''.
[[category:programming]][[category:tutorials]]
[[category:programming]][[category:tutorials]]

Revision as of 12:07, 27 May 2006

The default release mode that comes with the Source SDK's Visual Studios Projects is acceptable for many mods, but it can be made better and faster with some small changes.

In the project properties page of your client and server, change these settings to optimize your DLL files.

  1. General
    Whole Program Optimization 'yes'
    Note.pngNote:Memory requirements can be very high when compiling with Whole Program Optimization on
  2. C/C++ add these two switches to the 'command line':
    /GL /G7
  3. Link add these three switches to the 'command line':
    /OPT:ICF /OPT:WIN98 /LTCG
    Note.pngNote:You should only need to use /LTCG if you built the vgui_controls.lib with the fixes.

It will take longer for it to link the code, but it will run faster than with the default settings.

You can also enable SSE (Streaming SIMD Extensions) optimizations due to the minium requirements of HL2 being a 1.2 GHz CPU, that defaults to a Pentium 4, or AMD Athlon that support this technology. This can be found under the Code Generation.