Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] (PR#3781) Micro size of structs optimizations
Home

[Freeciv-Dev] (PR#3781) Micro size of structs optimizations

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#3781) Micro size of structs optimizations
From: "Rafa³ Bursig" <bursig@xxxxxxxxx>
Date: Mon, 24 Mar 2003 10:17:51 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Dnia 2003.03.24 18:44 Per I. Mathisen napisa³(a):
> 
> On Mon, 24 Mar 2003, Rafa? Bursig wrote:
> > Attached patch almost don't change structs only sort variables. I
> > change some types city.h to show that we can reduce size of game
> > structs even more ( sizeof(struct city) : before 2128,after 2028 )
> 
> But is this really faster? Have you measured this?
> 
As I say it is micro optimizations and rather depend on cpu power.

> While the patch may seem innocent enough, it breaks a lot of patches
Changing varible types in city.h was only example that we can even more 
reduce size of some structs. It can break some patches that use numbers 
biggers that I ever seen in game ( exp. city size > 128 ) but IMHO only 
sorting variables don't break anythings. IMHO we should chande game 
structs variables to network variables size ( real size sent by net 
code ).

> and introduces sorting of variables in structs by optimization rather 
> than
> logic, which is not good for code readability reasons.
That depens what /* comment */ you made in code. Some compilers make 
such sorting during build time but gcc don't do it and programer must 
do it manualy. And don't say me that reducing size of code won't have 
any influence.

Rafal

----------------------------------------------------------------------
Kochasz pilke nozna? Zagraj i wygraj! >>> http://link.interia.pl/f16fa 





[Prev in Thread] Current Thread [Next in Thread]