
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tlug] Giving a program priority briefly
>> I also got some surprises such as calling a function in the same class
>> gave no slowdown, but moving the function (marked as inline) to the base
>> class (these are classes with no virtual functions) gave nearly over a
>> 5% slowdown. So I used a macro.
>
> That is quite surprising!
>
> Are you using g++? WTF is the compiler doing!?...
> Can you post your compiler options? Especially optimisation settings.
I wasn't confident I'd remembered to use both "inline" and "all_inline"
keyword, so I just repeated that change, and it definitely gives the
slowdown when I move it up to the base class. I've left that function
in, but commented out, in case anyone wants to play with it further, or
file it as a compiler bug, when I release the code. [1] are compiler
options, [2] is the function, and [3] shows the macro and how it is called.
Darren
----------------
[1]:
g++ -W -Wall -Wconversion -Wshadow -Werror -lboost_serialization -O3
-march=i686 -fomit-frame-pointer -DNDEBUG -ffast-math -frename-registers
-DBOOST_SMART_ASSERT_MODE=0 -o ego_opt2 gtp.cpp main.cpp
[2]:
all_inline inline bool is_legal(v::t v){
return (!board->is_eyelike (player,v) && board->play_no_pass (player,v)
< play_ss_suicide);
}
[3]:
#define RETURN_IF_LEGAL(V) if (!board->is_eyelike (player,(V)) &&
board->play_no_pass (player,(V)) < play_ss_suicide) return (V);
//#define RETURN_IF_LEGAL(V)if(is_legal(V))return (V);
Home |
Main Index |
Thread Index