[web-devel] Caching the System time

Kazu Yamamoto ( 山本和彦 ) kazu at iij.ad.jp
Mon Aug 22 08:44:02 CEST 2011


Simon,

Thank you for your explanation.

> For example, the new builder in the
> bytestring library provides functions for the decimal encoding of
> numbers directly into the output buffer using a fast C-implementation.

Do you refer to hPutBuilder in Data.ByteString.Lazy.Builder? If so, I
have a question.

For logging systems, a line of a log message must be guaranteed. Log
messages must not be mangled in a log file.

It seems to me hPutBuilder can grantee lines if Handle's buffering is
the line buffering. However, it seems to me that it cannot grantee
lines if Handle's buffering is the block buffering. Is my
understanding correct?

To implement *multi-line* buffering, we need to know the length of a
log message to be written in advance. If it is larger than the size of
the free space of Handle's buffer, the buffer must be flushed
first. I'm not sure that we can obtain the length of Builder without
building(copying).

--Kazu



More information about the web-devel mailing list