diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-23 11:22:07 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-23 11:22:07 +0200 |
commit | d798f5b66f4ae699f352b6c40abd07495eff8f94 (patch) | |
tree | a5b7aa9e90a6639f2b86a3d7f3a5e13615055907 /runtime/syslogd-types.h | |
parent | ce5869f7c41c8db943d8cbe804b69af40d43e2e6 (diff) | |
download | rsyslog-d798f5b66f4ae699f352b6c40abd07495eff8f94.tar.gz rsyslog-d798f5b66f4ae699f352b6c40abd07495eff8f94.tar.xz rsyslog-d798f5b66f4ae699f352b6c40abd07495eff8f94.zip |
some more optimizations
- done malloc() instead of calloc() for msg_t, as we have large space
which needs not be initialized
- shrunk syslogTime structure in the hope to get better cache and
write performance (non-aligned data should not hurt much here)
Diffstat (limited to 'runtime/syslogd-types.h')
-rw-r--r-- | runtime/syslogd-types.h | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/runtime/syslogd-types.h b/runtime/syslogd-types.h index be0dfdd8..83b38f28 100644 --- a/runtime/syslogd-types.h +++ b/runtime/syslogd-types.h @@ -78,23 +78,25 @@ typedef enum _EHostnameCmpMode EHostnameCmpMode; /* rgerhards 2004-11-11: the following structure represents * a time as it is used in syslog. + * rgerhards, 2009-06-23: packed structure for better cache performance + * (but left ultimate decision about packing to compiler) */ struct syslogTime { - int timeType; /* 0 - unitinialized , 1 - RFC 3164, 2 - syslog-protocol */ - int year; - int month; - int day; - int hour; /* 24 hour clock */ - int minute; - int second; - int secfrac; /* fractional seconds (must be 32 bit!) */ - int secfracPrecision; + intTiny timeType; /* 0 - unitinialized , 1 - RFC 3164, 2 - syslog-protocol */ + intTiny month; + intTiny day; + intTiny hour; /* 24 hour clock */ + intTiny minute; + intTiny second; + intTiny secfracPrecision; + intTiny OffsetMinute; /* UTC offset in minutes */ + intTiny OffsetHour; /* UTC offset in hours + * full UTC offset minutes = OffsetHours*60 + OffsetMinute. Then use + * OffsetMode to know the direction. + */ char OffsetMode; /* UTC offset + or - */ - char OffsetHour; /* UTC offset in hours */ - int OffsetMinute; /* UTC offset in minutes */ - /* full UTC offset minutes = OffsetHours*60 + OffsetMinute. Then use - * OffsetMode to know the direction. - */ + short year; + int secfrac; /* fractional seconds (must be 32 bit!) */ }; typedef struct syslogTime syslogTime_t; |