Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Giving a program priority briefly
- Date: Mon, 11 Jun 2007 08:21:49 +0900
- From: Darren Cook <darren@example.com>
- Subject: Re: [tlug] Giving a program priority briefly
- References: <466B5A87.7000002@dcook.org> <78d7dd350706100221u524aa0baxa6498541674863b0@mail.gmail.com> <466BD066.90302@dcook.org> <d8fcc0800706100704h4dcf13d9h6955f03d0c09dc34@mail.gmail.com>
- User-agent: Thunderbird 1.5.0.10 (X11/20070301)
>> 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);
- Follow-Ups:
- Re: [tlug] Giving a program priority briefly
- From: Josh Glover
- References:
- [tlug] Giving a program priority briefly
- From: Darren Cook
- Re: [tlug] Giving a program priority briefly
- From: Nguyen Vu Hung
- Re: [tlug] Giving a program priority briefly
- From: Darren Cook
- Re: [tlug] Giving a program priority briefly
- From: Josh Glover
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Giving a program priority briefly
- Next by Date: Re: [tlug] contribution to F/OSS community
- Previous by thread: Re: [tlug] Giving a program priority briefly
- Next by thread: Re: [tlug] Giving a program priority briefly
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links