Re: Further adventures in the land of 64-bit linux

Guido van Rossum <[email protected]> Mon, 16 Sep 2002 23:25:11 -0400
Newsgroups gmane.comp.python.snake-farm.user
Message-ID <[email protected]>
> test_longexp consumes about 25MB of data space on my 32-bit box.  A parse
> node contains two pointers so at least those two fields are twice as big on
> a 64-bit box.  It may (or may not) help to rearrange the struct decl to
> order the fields from widest to narrowest:
> 
> Current:
> 
> typedef struct _node {
>     short		n_type;
>     char		*n_str;
>     int			n_lineno;
>     int			n_nchildren;
>     struct _node	*n_child;
> } node;
> 
> Possibly more space-efficient:
> 
> typedef struct _node {
>     char		*n_str;
>     struct _node	*n_child;
>     int			n_lineno;
>     int			n_nchildren;
>     short		n_type;
> } node;
> 
> At least one n_child vector grows very large in test_longexp.

Alas, I think both structs would have the same size.  The old one
wastes 6 bytes after n_type.  So does the new one.  Both would be 32
bytes long.

(I checked this in, not realizing this.  I'll back it out.)

--Guido van Rossum (home page: http://www.python.org/~guido/)