我不知道有什么可以作为理由,更大的结构访问更慢。为什么更大的结构更慢?
例如。 w ^得结构:
第一:
typedef struct TAL {
struct TAL *next;
int v;
int a;
int b;
int c;
} LAL;
和第二:
typedef struct TAL {
struct TAL *next;
int v;
} LAL;
,简单地探索列表
LAL *tmp;
tmp = AL;
while(tmp != 0)
{
tmp = tmp -> next;
}
小stucture的执行时间(秒)小于第一。 什么是理由?
你怎么测量时间?也许那是你的错误所在。 – Grim 2011-04-17 11:45:03