4 NOTE: this file may be seriously outdated. I haven't had time to go over
5 it yet. Let me know if there are problems.
7 -- Mike (mvanier@cs.caltech.edu)
10 This describes how to port GNU shogi to machines with scarce memory.
11 GNU shogi's minimal requirements are:
12 - approximately 200 kBytes memory for the executable program.
13 - at least 300 kBytes for data structures.
14 You don't want to port GNU shogi to a machine with less memory than that.
16 GNU shogi is optimized for speed and that means that memory has been used
17 when there has been a tradeoff between memory usage and speed. If you intend
18 to run GNU shogi on a machine with less than 4 Mbyte memory the size of some
19 data structures have to be reduced. Here is a list of the largest data
20 structures in GNU shogi, their sizes and a small comment on what can
21 be done to reduce their size:
23 ttable: 1.5 MByte (#define vttblsz <something small>)
24 etab: 1.4 MByte (can be removed)
25 Tree: 42 kByte (change f,t to unsigned char)
26 history: 131 kByte (can be removed, not recommended)
27 nextpos: 98 kByte (nothing save rewiting all move generation)
28 nextdir: 98 kByte (nothing save rewiting all move generation)
29 distdata: 6 kByte (can be changed to a macro)
30 ptype_distdata: 98 kByte (can be changed to a procedure)
31 hashcode: 26 kByte (no reduction possible)
33 First of all, start by reducing the transposition table size, this
34 is done by setting vttblsz in (gnushogi.h). If the transopsition table
35 does not fit entierly in memory it will have a detrimental effect on
36 performance. You can remove the transposition table by defining
37 compiler option NOTTABLE.
38 You can remove the static evaluation cache by omitting the compiler
40 You can remove the history table by omitting the compiler option HISTORY
42 If this isn't enough, reconsider if you really want to do this port.
43 There isn't really that much to gain by changing the other
46 There are some switches in order to enable space reduction:
48 #define SAVE_PTYPE_DISTDATA (replace ptype_distdata by a procedure)
49 #define SAVE_DISTDATA (replace distdata by a macro)