diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-01-15 15:01:16 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-01-15 15:01:16 +0100 |
commit | 9273b4bb4dcb6683cf6825fedd3cb5cd0f59805a (patch) | |
tree | 57b9d3b9092723e4605206c02f39356ae5dfd698 /tools/syslogd.c | |
parent | bd0d7bc621ac78a43a964139242bf3f1983f05b9 (diff) | |
download | rsyslog-9273b4bb4dcb6683cf6825fedd3cb5cd0f59805a.tar.gz rsyslog-9273b4bb4dcb6683cf6825fedd3cb5cd0f59805a.tar.bz2 rsyslog-9273b4bb4dcb6683cf6825fedd3cb5cd0f59805a.zip |
optimize memory layout for much better cache hits
Moave element status out of batch_obj_t because we
get a *much* better cache hit ratio this way.
Note that this is really a HUGE saving, even if it
doesn't look so (both profiler data as well as
practical tests indicate that!).
Diffstat (limited to 'tools/syslogd.c')
-rw-r--r-- | tools/syslogd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c index bd5b52ca..a4b53d1f 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -527,7 +527,7 @@ preprocessBatch(batch_t *pBatch) { if(!bIsPermitted) { DBGPRINTF("Message from '%s' discarded, not a permitted sender host\n", fromHostFQDN); - pBatch->pElem[i].state = BATCH_STATE_DISC; + pBatch->eltState[i] = BATCH_STATE_DISC; } else { /* save some of the info we obtained */ MsgSetRcvFromStr(pMsg, fromHost, ustrlen(fromHost), &propFromHost); @@ -538,7 +538,7 @@ preprocessBatch(batch_t *pBatch) { if((pMsg->msgFlags & NEEDS_PARSING) != 0) { if((localRet = parser.ParseMsg(pMsg)) != RS_RET_OK) { DBGPRINTF("Message discarded, parsing error %d\n", localRet); - pBatch->pElem[i].state = BATCH_STATE_DISC; + pBatch->eltState[i] = BATCH_STATE_DISC; } } if(pMsg->pRuleset != batchRuleset) @@ -573,7 +573,7 @@ msgConsumer(void __attribute__((unused)) *notNeeded, batch_t *pBatch, int *pbShu //do not have this yet and so we emulate -- 2010-06-10 int i; for(i = 0 ; i < pBatch->nElem && !*pbShutdownImmediate ; i++) { - pBatch->pElem[i].state = BATCH_STATE_COMM; + pBatch->eltState[i] = BATCH_STATE_COMM; } RETiRet; } |