Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Object files and code speed

Author: Dann Corbit

Date: 13:59:02 10/23/03

Go up one level in this thread


On October 23, 2003 at 16:19:38, Matthew McKnight wrote:

>I also tried the intel compiler and actually the vc6 executable was faster.
>I've considered switching for some time, but with all the service packs, and the
>entire thing having been written/profiled/optimized for vc6, i think i'll just
>stick.  I am assuming that the results of this test would be similar with any
>other compiler though.
>
>Matt

You can have your cake and eat it too.  I have to ways to compile crafty builds.
 One is the normal way, where I just compile it file by file like everyone else.
 The other way is this cheesy "#include everything" trick.  It lets the compiler
make better decisions about what to inline and things of that nature.  Perhaps
the compiler can also relocate functions better (not sure).  At any rate it
makes for faster binaries.  On the other hand, you have to make sure that all
your header files are idempotent.

This is my main crafty file for optimized builds called "blob.c":


#ifdef _WIN32
#include <windows.h>
#include <process.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#endif

#include "chess.h"
#include "lock.h"
#include "data.h"
#include "epddefs.h"
#include "epdglue.h"
#include "epd.h"
#include "evaluate.h"
#include "vcinline.h"
#include "x86.c"
#include "boolean.c"
#include "swap.c"
#include "attacks.c"
#include "evaluate.c"
#include "make.c"
#include "unmake.c"
#include "movgen.c"
#include "quiesce.c"

#ifdef DO_EXTENSIONS
#include "searche.c"
#else
#ifdef DO_BM_EXTENSIONS
#include "searchb.c"
#include "sing.c"
#else
#include "search.c"
#endif          /* DO_BM_EXTENSIONS */
#endif          /* DO_EXTENSIONS */

#include "next.c"
#include "searchr.c"
#include "repeat.c"
#include "nextr.c"
#include "history.c"
#include "nexte.c"
#include "utility.c"
#include "valid.c"
#include "searchmp.c"
#include "thread.c"
#include "enprise.c"
#include "book.c"
#include "data.c"
#include "drawn.c"
#include "edit.c"
#include "epd.c"
#include "epdglue.c"
#include "init.c"
#include "input.c"
#include "interupt.c"
#include "iterate.c"
#include "main.c"
#include "output.c"
#include "phase.c"
#include "ponder.c"
#include "preeval.c"
#include "resign.c"
#include "root.c"
#include "learn.c"
#include "setboard.c"
#include "test.c"
#include "time.c"
#include "validate.c"
#include "annotate.c"
#include "option.c"
#include "analyze.c"
#include "evtest.c"
#include "bench.c"
#include "testepd.c"

#ifdef DO_BM_EXTENSIONS
#include "hashb.c"
#else
#include "hash.c"
#endif          /* DO_BM_EXTENSIONS */

#include "probe.c"





This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.