PtokaX forum

Development Section => PtokaX Development Versions => Topic started by: PPK on 06 February, 2011, 03:52:30

Title: 0.4.1.2e
Post by: PPK on 06 February, 2011, 03:52:30
Windows version with GUI: http://www.PtokaX.org/files/0.4.1.2e.7z
Windows x64 version with GUI: http://www.PtokaX.org/files/0.4.1.2e-x64.7z
Windows service: http://www.PtokaX.org/files/0.4.1.2e-service.7z
Windows x64 service: http://www.PtokaX.org/files/0.4.1.2e-service-x64.7z
Source for unix systems: http://www.PtokaX.org/files/0.4.1.2e-nix-src.tgz


Quote from: ChangesAdded: Column sorting to registered users list in registered users frame.
Added: Filter to registered users frame.
Added: Missing maximize icon to script editor window.
Added: Registered users window.
Fixed: Crash when script throw error on startup (thx TiMeTrAVelleR for report).
Fixed: Possible memory leak in script editor on script loading.

(http://www.ptokax.org/files/PX_Regs.png)
Title: Re: 0.4.1.2e
Post by: P_pan on 06 February, 2011, 10:09:47
great job PPK!  thank you!
Title: Re: 0.4.1.2e
Post by: mariner on 06 February, 2011, 13:56:41
Great job, PPK, but when do you fix your spaghetti code? For example:
hashBanManager.cpp:249 uint16_t ui16dx = ((uint16_t *)&Ban->ui32IpHash)[0];
This code doesn't work on big-endian architectures. And it's fails with strict-aliasing (O2 level in g++)
Title: Re: 0.4.1.2e
Post by: PPK on 06 February, 2011, 19:54:33
I don't have any big-endian arch for testing, so it is hard to fix something for that ::) And PtokaX don't use O2, so i have nothing to fix :P And when you want to call something as "spaghetti code" then first read what spaghetti code is  8)
Title: Re: 0.4.1.2e
Post by: PPK on 07 February, 2011, 01:58:55
I'm miss that code is related to ip hashtable... in future (maybe this year) will be added tcp/ip v6 support, and for that all ip related things will be rewritten :D
Title: Re: 0.4.1.2e
Post by: mariner on 07 February, 2011, 11:50:01
With O2 level PtokaX work faster.  I think, that's is better, then O0 level. You can fix this error easy.
hashBanManager.cpp:249 uint16_t ui16dx = (uint16_t ) Ban->ui32IpHash; This code don't fails on O2 and O3 levels and works on big-endian arch. Keep it simple.
Title: Re: 0.4.1.2e
Post by: PPK on 07 February, 2011, 15:02:05
PtokaX can't work faster with O2. Test with performance profiler show that most time is used in send and recv socket function. Higher optimization level can't make that faster ::)
I can't test if is really not working on big-endian, i don't see any reason why this code should fail. Number will be different, but that should be all :o
Title: Re: 0.4.1.2e
Post by: mariner on 07 February, 2011, 20:08:58
But this code fail. On b-e arch you code will take other part of numeric variable. So, if you have Ban->ui32IpHash less then 65536, you will have zero in ui16dx.  On the l-e arch you will have value of Ban->ui32IpHash  in  ui16dx (if value less then 65536). Read about big-endian.
Title: Re: 0.4.1.2e
Post by: PPK on 08 February, 2011, 05:15:15
Quote from: mariner on 07 February, 2011, 20:08:58
So, if you have Ban->ui32IpHash less then 65536, you will have zero in ui16dx.
And that is perfectly acceptable for me, because lower than 65536 are ip addresses below 0.1.0.0 :P That is not fail, that is how it works ;)
Title: Re: 0.4.1.2e
Post by: Snooze on 11 February, 2011, 09:18:42
Hi PPK,Will you be making x64 libs available for the x64 build as well?Libs I'm interested in:- lfs- socket- sqliteThanks,Snooze
Title: Re: 0.4.1.2e
Post by: PPK on 11 February, 2011, 18:40:20
Why me ? ::) Source for libs is available. Visual studio express is free download on ms site. I have better things to do than compile libs.
Title: Re: 0.4.1.2e
Post by: mariner on 14 February, 2011, 05:56:57
Dear PPK, compile this code and test it. You will have equal result
#include <iostream>
#include <stdint.h>

using namespace std;

int main() {
uint32_t a;
uint16_t b, c;
cout << "Insert the value: " << endl;
cin >> a;
b = (uint16_t) a;
c = ((uint16_t *)&a)[0];
cout << "Mariner code result: " << b << endl << "PPK code result: " << c << endl;
return 0;
}

Now about compilation
Quotegyrt ~ % g++ -O0 -Wall -Wextra test.cpp -o test                            9:09
gyrt ~ % ./test                                                            9:09
Insert the value:
65500
Mariner code result: 65500
PPK code result: 65500
gyrt ~ % ./test                                                            9:10
Insert the value:
65536
Mariner code result: 0
PPK code result: 0
gyrt ~ % ./test                                                            9:10
Insert the value:
65537   
Mariner code result: 1
PPK code result: 1
gyrt ~ % g++ -O1 -Wall -Wextra test.cpp -o test                            9:10
gyrt ~ % ./test                                                            9:10
Insert the value:
65500
Mariner code result: 65500
PPK code result: 65500
gyrt ~ % ./test                                                            9:10
Insert the value:
65536
Mariner code result: 0
PPK code result: 0
gyrt ~ % ./test                                                            9:11
Insert the value:
65537
Mariner code result: 1
PPK code result: 1
gyrt ~ % g++ -O2 -Wall -Wextra test.cpp -o test                            9:11
test.cpp: In function ?int main()?:
test.cpp:12: warning: dereferencing type-punned pointer will break strict-aliasing rules
test.cpp:12: warning: dereferencing pointer ?a.60? does break strict-aliasing rules
test.cpp:12: note: initialized from here
gyrt ~ % ./test                                                            9:11
Insert the value:
65500
Mariner code result: 65500
PPK code result: 65500
gyrt ~ % ./test                                                            9:11
Insert the value:
65536
Mariner code result: 0
PPK code result: 0
gyrt ~ % ./test                                                            9:11
Insert the value:
65537
Mariner code result: 1
PPK code result: 1
gyrt ~ % ./test                                                            9:11
Insert the value:
67000
Mariner code result: 1464
PPK code result: 1464
So, you can see, that your code fails, when we use optimizations. Futhermore, after optimization didn't work some LUA API functions.

Why do you use difficult code instead of simple?
Title: Re: 0.4.1.2e
Post by: PPK on 14 February, 2011, 12:50:08
Where it's that fail  ??? In all cases it is giving same values, or i'm missing something ?
Title: Re: 0.4.1.2e
Post by: mariner on 14 February, 2011, 18:37:42
PtokaX fails when we use flag -O2 with your code. If I use simple code from my example - ptokax works correctly. I can send you 2 binaries, compiled on Debian and you can test it.
Title: Re: 0.4.1.2e
Post by: PPK on 14 February, 2011, 22:49:59
As you show with your example there is no fail with -O2 and your code is giving same result as my code. All what you do was wasting my time. So if you don't show any fail i will not reply to you anymore...
Title: Re: 0.4.1.2e
Post by: sphinx_spb on 19 February, 2011, 13:41:33
Dear mariner, if you would create hub-soft better than Ptokax (i.e. more reliable, stable, maybe even without spaghetti) - I would take off my hat.
Until that, your claims looks miserable.

update:
you can also modify sources, they're still open.
Title: Re: 0.4.1.2e
Post by: PPK on 19 February, 2011, 15:07:39
Quote from: sphinx_spb on 19 February, 2011, 13:41:33
you can also modify sources, they're still open.
And that is his problem, he changed source. He switched compiler mode to complainer and bad things happen ::)
Title: Re: 0.4.1.2e
Post by: mariner on 20 February, 2011, 16:20:00
Quotehe changed source
With out change ptokax lua api works bad.

Check this archive. This is PtokaX for x86_32 Linux.
~/PtokaX % gcc -v                                                                                               
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu4)

~/PtokaX % dpkg -l G libc6
ii  libc6                                 2.7-10ubuntu8                      GNU C Library: Shared libraries
ii  libc6-dev                             2.7-10ubuntu8                      GNU C Library: Development Libraries and Hea
ii  libc6-i686                            2.7-10ubuntu8                      GNU C Library: Shared libraries [i686 optimi

In the archive you can see a script, wich send a message if you is an unregistred user. So I register user. On standart PtokaX i have no notification after I connected as registred user. After that I start PtokaX compiled with -O2 flag. And after I connected to hub I see a message for unregistred user. So after that I run a PtokaX compiled with my changes in the code. And bot didn't send any notifications for unregistred user.

PS and little forum bag  :P
QuotePtokaX.tar.gz.
You cannot upload that type of file. The only allowed extensions are jpg,gif,png,lua,rar,7z,zip,tar.gz.
Title: Re: 0.4.1.2e
Post by: PPK on 20 February, 2011, 16:39:11
Quote from: mariner on 20 February, 2011, 16:20:00
With out change ptokax lua api works bad.
And nobody noticed it in 3 years ?
Quote from: mariner on 20 February, 2011, 16:20:00
On standart PtokaX i have no notification after I connected as registred user. After that I start PtokaX compiled with -O2 flag. And after I connected to hub I see a message for unregistred user.
First you wrote that without change lua api works bad. Second you wrote that without change it works ok.
For me it works ok, even when that script is crap.
function UserConnected(user)
if tCfg.ShowToUnreg and not RegMan.GetReg(user.sNick) then
ToUser(user,tMsg.Unreg)
end
UserMenu(user)
end

OpConnected = UserConnected
RegConnected = UserConnected


This is very bad scripting style, way how to cause PtokaX using much more cpu than is needed. Is should be something like:

function UserConnected(user)
if tCfg.ShowToUnreg then
ToUser(user,tMsg.Unreg)
end
UserMenu(user)
end

function OpConnected(user)
    UserMenu(user)
end
function RegConnected(user)
    UserMenu(user)
end
Title: Re: 0.4.1.2e
Post by: mariner on 21 February, 2011, 08:05:31
QuoteFirst you wrote that without change lua api works bad. Second you wrote that without change it works ok.
Without change I cannot compile ptokax with -O2 option. I upload an archive with 3 different binaries.
PtokaX_standart - ptokax from source without any changes.
PtokaX_O2 -  compiled with this g++ flags  -O2 -fomit-frame-pointer -fstack-protector
PtokaX_modified - PtokaX with changes source and compiled with g++ flags  -O2 -fomit-frame-pointer -fstack-protector

PtokaX_standart: Lua API works good but has no optimizations.
PtokaX_O2: PtokaX works faster, but has problems with lua API.
PtokaX_modified: Lua API works good and has some optimizatoins.

Just test it!

Why didn't you want to change code with warnings? I don't understand it. Futhermore, O2-option is a standart flag in many Linux Dists.
Title: Re: 0.4.1.2e
Post by: PPK on 21 February, 2011, 16:43:00
PtokaX compiled from my source don't show any warning (i'm compiled 0.4.1.2e on debian lenny and debian squeeze before release). PtokaX compiled from my source is working correctly (you wrote that multiple times). If you don't want problems then don't modify my source. Source was released to allow users to compile PtokaX on theyr os, not to allow them to modify it and then complains that it is not working correctly because they are stupid and change something that they shouldn't >:( And no, PtokaX is not working faster with -O2, because when he is working faster (as old 0.3.3.x versions), then big hubs can't run on it (faster data sending -> PtokaX will use all upload on startup when is sending userlist to new users -> when all upload is used then many users is disconnected randomly -> they connect again -> again all upload is used -> again drop... neverending story with bad end).

When you want lower cpu usage, then use better scripts. Not crap like that one from your archive :-X
Title: Re: 0.4.1.2e
Post by: bastya_elvtars on 21 February, 2011, 19:25:51
I think anyone can contribute patches. It is however better to have conversations in a nice manner, unlike the first comment regarding this spaghetti stuff. Oh and nice snippet, Mutor. ;-)
Title: Re: 0.4.1.2e
Post by: mariner on 24 February, 2011, 09:25:54
It's my last proof for PPK. This is test programm, compiled on mips (be arch). System - debian lenny
Title: Re: 0.4.1.2e
Post by: PPK on 24 February, 2011, 14:45:55
Proof that it is working correctly. And you always don't understand how it is working :-X
Is really simple. On little ending it is getting number from second part of ip (0.0.x.x), on big endian from first part of ip (x.x.0.0). That is how it was designed and as you show how it is correctly working  :P
Title: Re: 0.4.1.2e
Post by: bastya_elvtars on 24 February, 2011, 18:05:40
Quote from: Mutor on 20 February, 2011, 16:57:25
There is nothing wrong with the Lua API.
To be most efficient make as few API calls as is required.
Consider streamlining your code. For example the user.iProfile
is available in the connect arrivals, there is no need to call RegMan.

Totally agree. As a rule of thumb, make as few function calls as possible in order to have fast code. Table lookups are cheap, function calls aren't.
By the way, ain't UserConnected only called when an unregistered user enters?
Title: Re: 0.4.1.2e
Post by: PPK on 24 February, 2011, 18:18:01
Quote from: bastya_elvtars on 24 February, 2011, 18:05:40
By the way, ain't UserConnected only called when an unregistered user enters?
Of course it is ::)
Title: Re: 0.4.1.2e
Post by: mariner on 28 February, 2011, 07:58:30
Hm. I tests PtokaX on different arches. And everywere have equel result. Sources from your tarball and with my modifications works correctly. So, I think, you right. Your code work correctly, if we don't use optimizations flags(I don't understand one thing. Why is reducing cpu usage bad?). Sorry PPK.
Title: Re: 0.4.1.2e
Post by: PPK on 01 March, 2011, 23:11:59
Optimizations can cause many bugs (for example look to kernel changelog how many fixes for gcc bugs they have), and posix PtokaX have enough bugs without that (high memory usage, buggy timers, incompatibility with udp-debugger when running on big-endian...)  ::)
Title: Re: 0.4.1.2e
Post by: PPK on 04 February, 2012, 20:34:29
As i wrote, with IPv6 support was strict-aliasing issue partially fixed. SVN rev 72 is fixing rest :P

Compile @ debian wheezy with O3 (O2 have same result)
Quoteroot@wheezy:/home/petr/PtokaX# make
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/ClientTagManager.cpp -o /home/petr/PtokaX/obj/ClientTagManager.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/colUsers.cpp -o /home/petr/PtokaX/obj/colUsers.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/DcCommands.cpp -o /home/petr/PtokaX/obj/DcCommands.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/DeFlood.cpp -o /home/petr/PtokaX/obj/DeFlood.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/eventqueue.cpp -o /home/petr/PtokaX/obj/eventqueue.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/globalQueue.cpp -o /home/petr/PtokaX/obj/globalQueue.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/hashBanManager.cpp -o /home/petr/PtokaX/obj/hashBanManager.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/hashUsrManager.cpp -o /home/petr/PtokaX/obj/hashUsrManager.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/hashRegManager.cpp -o /home/petr/PtokaX/obj/hashRegManager.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/HubCommands.cpp -o /home/petr/PtokaX/obj/HubCommands.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/IP2Country.cpp -o /home/petr/PtokaX/obj/IP2Country.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/LanguageManager.cpp -o /home/petr/PtokaX/obj/LanguageManager.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/LuaBanManLib.cpp -o /home/petr/PtokaX/obj/LuaBanManLib.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/LuaCoreLib.cpp -o /home/petr/PtokaX/obj/LuaCoreLib.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/LuaIP2CountryLib.cpp -o /home/petr/PtokaX/obj/LuaIP2CountryLib.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/LuaProfManLib.cpp -o /home/petr/PtokaX/obj/LuaProfManLib.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/LuaRegManLib.cpp -o /home/petr/PtokaX/obj/LuaRegManLib.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/LuaScript.cpp -o /home/petr/PtokaX/obj/LuaScript.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/LuaScriptManager.cpp -o /home/petr/PtokaX/obj/LuaScriptManager.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/LuaScriptManLib.cpp -o /home/petr/PtokaX/obj/LuaScriptManLib.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/LuaSetManLib.cpp -o /home/petr/PtokaX/obj/LuaSetManLib.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/LuaTmrManLib.cpp -o /home/petr/PtokaX/obj/LuaTmrManLib.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/LuaUDPDbgLib.cpp -o /home/petr/PtokaX/obj/LuaUDPDbgLib.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/ProfileManager.cpp -o /home/petr/PtokaX/obj/ProfileManager.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/PtokaX-nix.cpp -o /home/petr/PtokaX/obj/PtokaX.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/pxstring.cpp -o /home/petr/PtokaX/obj/pxstring.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/RegThread.cpp -o /home/petr/PtokaX/obj/RegThread.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/ResNickManager.cpp -o /home/petr/PtokaX/obj/ResNickManager.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/ServerManager.cpp -o /home/petr/PtokaX/obj/ServerManager.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/ServerThread.cpp -o /home/petr/PtokaX/obj/ServerThread.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/serviceLoop.cpp -o /home/petr/PtokaX/obj/serviceLoop.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/SettingManager.cpp -o /home/petr/PtokaX/obj/SettingManager.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/TextFileManager.cpp -o /home/petr/PtokaX/obj/TextFileManager.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/UdpDebug.cpp -o /home/petr/PtokaX/obj/UdpDebug.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/UDPThread.cpp -o /home/petr/PtokaX/obj/UDPThread.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/User.cpp -o /home/petr/PtokaX/obj/User.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/utility.cpp -o /home/petr/PtokaX/obj/utility.o
g++ -O3 -g -Wall -Wextra -Itinyxml -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /home/petr/PtokaX/core/ZlibUtility.cpp -o /home/petr/PtokaX/obj/ZlibUtility.o
g++ \
        /home/petr/PtokaX/obj/ClientTagManager.o /home/petr/PtokaX/obj/colUsers.o /home/petr/PtokaX/obj/DcCommands.o /home/petr/PtokaX/obj/DeFlood.o /home/petr/PtokaX/obj/eventqueue.o /home/petr/PtokaX/obj/globalQueue.o /home/petr/PtokaX/obj/hashBanManager.o /home/petr/PtokaX/obj/hashUsrManager.o \
        /home/petr/PtokaX/obj/hashRegManager.o /home/petr/PtokaX/obj/HubCommands.o /home/petr/PtokaX/obj/IP2Country.o /home/petr/PtokaX/obj/LanguageManager.o /home/petr/PtokaX/obj/LuaBanManLib.o /home/petr/PtokaX/obj/LuaCoreLib.o /home/petr/PtokaX/obj/LuaIP2CountryLib.o \
        /home/petr/PtokaX/obj/LuaProfManLib.o /home/petr/PtokaX/obj/LuaRegManLib.o /home/petr/PtokaX/obj/LuaScript.o /home/petr/PtokaX/obj/LuaScriptManager.o /home/petr/PtokaX/obj/LuaScriptManLib.o /home/petr/PtokaX/obj/LuaSetManLib.o /home/petr/PtokaX/obj/LuaTmrManLib.o \
        /home/petr/PtokaX/obj/LuaUDPDbgLib.o /home/petr/PtokaX/obj/ProfileManager.o /home/petr/PtokaX/obj/PtokaX.o /home/petr/PtokaX/obj/pxstring.o /home/petr/PtokaX/obj/RegThread.o /home/petr/PtokaX/obj/ResNickManager.o /home/petr/PtokaX/obj/ServerManager.o /home/petr/PtokaX/obj/ServerThread.o \
        /home/petr/PtokaX/obj/serviceLoop.o /home/petr/PtokaX/obj/SettingManager.o /home/petr/PtokaX/obj/TextFileManager.o /home/petr/PtokaX/obj/UdpDebug.o /home/petr/PtokaX/obj/UDPThread.o /home/petr/PtokaX/obj/User.o /home/petr/PtokaX/obj/utility.o /home/petr/PtokaX/obj/ZlibUtility.o \
        /home/petr/PtokaX/tinyxml/tinyxml.a -o PtokaX -lpthread -llua5.1 -lrt -lz
Title: Re: 0.4.1.2e
Post by: PPK on 05 February, 2012, 15:21:34
And as expected, zero difference in cpu usage  :-X
Version without optimizations:
QuoteVersion: PtokaX DC Hub 0.4.2.0 [build 314] built on Oct 31 2011 00:10:37
OS: Linux 2.6.32.28 (x86_64)
Users (Max/Actual Peak (Max Peak)/Logged): 666 / 495 (649) / 482
CPU usage (60 sec avg): 0.25%
Version with O3 optimizations:
QuoteVersion: PtokaX DC Hub 0.4.2.0 [build 320] built on Feb  4 2012 20:01:49
OS: Linux 2.6.32.28 (x86_64)
Users (Max/Actual Peak (Max Peak)/Logged): 666 / 511 (649) / 486
CPU usage (60 sec avg): 0.26%

Compiler optimizations simply can't do miracles with code that was hand optimized by developer :P