degesch: optimize buffer memory usage

We have approximately 5 formatter_items per buffer_line.  Let's assume
we're on a 64-bit machine.  Then there were (5 * 2) + 3 useless pointers
(104 bytes) as well as 5 * (4 + 4) = 40 bytes of wasted space because
of needless padding.  That's 144 bytes already.  Compared to that, this
change adds 16 bytes of overhead for an array sentinel, i.e. 128B less.

With a limit of 1000 lines per buffer, we've saved ~128kB per buffer
on completely useless data, and code complexity stays roughly the same.

All in all, memory usage for buffers should be about 50% lower.
This commit is contained in:
2016-01-31 20:07:20 +01:00
parent 10a264ec3d
commit a850ee45f1
2 changed files with 41 additions and 35 deletions

2
NEWS
View File

@@ -12,6 +12,8 @@
* degesch: backlog limit was made configurable
* degesch: optimize buffer memory usage
* kike: add support for IRCv3.2 server-time
* Remote addresses are now resolved asynchronously