Hey,
Would one of the dev's mind checking in a couple of changes for
me to fix compiles with GCC 3.X
This wont break compiles with gcc 2.96, tested with one of my old servers and compiles just fine (the includes wouldnt make a difference, but I tested in case the using namespace std; addition might cause any flukes with gcc < 3.0
Add
#include <stdarg.h>
to the following files
world/zoneserver.cpp
world/console.cpp
zone/client.cpp
zone/worldserver.cpp
and this to the include section of 2 other files..
using namespace std;
to
common/EQPacketManager.cpp
world/console.cpp
If you add those in, everything should be 100% good to go for future gcc releases.. Its only a matter of time before 3 is the standard in every distro so better to put them in now than later I suppose...
Also, mind changing the mcpu=486 in the makefile to
march=i486 ?
This one Im not positive about though, it seems mcpu is for 2.2 kernels and v2 of gcc, and march=i486 is for 2.4 and greater. I would guess most development is being done with 2.4 or greater kernels, but I might just be on the bleeding edge here (just compiled the latest 2.5).
The new gcc doesnt like mcpu anymore, its recognized as being deprecated, so probably best to change to march.
For performance reasons though, I would recommend changing this to
march=pentium, or march=i586
though instead of i486. I doubt anyone is building on a stock 486 architecture though. Im pretty sure this option will work just fine for AMD's as well as Intel's, but I would check this out before compiling with this option on an AMD.
If anyone knows anymore about this, please feel free to chime in, any additional information would be great.
Performance Updates: Also, adding -O1, -O2, -O3 as a gcc compile option will enable maximal code optimization, might give you a bit of a performance boost. (can you tell Im really into performance issues?)
-O6 is the highest optimization level I believe. It has a chance of breaking the binary, so test it out without optimizations before building it with this one.
Also, on Intel machines, this option can help alot..
-fomit-frame-pointer
Don't keep the frame pointer in a register for functions that don't need one. This avoids the instructions to save, set up and restore frame pointers; it also makes an extra register available in many functions. It also makes debugging impossible on some machines.
Heres a good line to use in the makefile for performance compiling
-O3 -funroll-loops -fomit-frame-pointer -fno-strength-reduce -ffast-math
Im going to recompile everything tonight with -pg to enable profiling, then run it inside of gprof to see if i can identify any bottlenecks.. I'll check it with purify too and see if I can identify any memory leaks..
Also, optimizing your mysql database is a good idea too... If you compile yours like I do, heres a good resource for some mysql optimization tips..
http://www.devshed.com/Server_Side/M...ize/page1.html
An option for frequently accessed tables that contain non-critical information (stuff you can lose) is making those tables HEAPS so they are stored/indexed in memory. MyISM is the best all around tabletype. Problem with HEAPS though is you lose the data if the server crashes, but they are very fast.. Perfect for temp tables, but Im not sure that the emulator uses temp tables.. Also, you cant put a blob in a heap, so it wouldnt be useful for a few of our big tables (like items)
Boy this is fun !