I found his original post a little unclear. What I got out of it was:Milos wrote:And your idea about helping someone is to advice him the most banal thing like he's stupid or something.rbarreira wrote:OK good for you. Now how does that give you the right to be an annoying prick who says others are preaching and not helping?
Honestly I didn't get the idea that he was asking only for compile flags in the OP.
It would help if you actually read what ppl write instead of only making arrogant assumptions.
(1) his NPS was way slower than he wanted it to be, compared to e.g. Crafty,
(2) he doesn't want to give away his source code, and
(3) Jim already suggested PGO to him and he's tried that and he didn't see much improvement from it.
One possibility is that he might have made some mistake when trying the PGO. You have to run your program on representative workloads for a while so the profiler gets good data. But lets assume he did that properly.
There are lots of reasons his engine could be "way slower" than Crafty; if he were compiling in Debug or something, it would be way slower than Crafty. Okay, he's posting long command lines with O2 in them, so we can probably rule that out. What's left? Sure, he could fiddle with a few command line options, but that is not generally a way to make code "way faster". If you've turned off exceptions and RTTI and security checks, allowed it to inline and chosen the SSE2 instruction set, then you're most of the way there already.
Maybe his way of counting NPS is not the same as Crafty and other engines? For example, does he include hash hits as nodes?
Anyway, what other possible causes of slowness remain?
Well, the code might be doing dumb things. Passing structures by value, making unnecessary recursive calls, incurring unnecessary cache misses, etc. That was my first guess when I read the OP because its quite easy for a first engine to be slow.
Fixing that sort of stuff will probably help a lot more than tweaking some command line options. He doesn't want to share his source code, so its hard to offer concrete suggestions about those things, isn't it?