The function doing escaping was sadly quadratic in the length of successive character that are converted to htmlentities (now it's linear).
Avoid to construct intermediary list for block of non escaped and escaped chars
Avoid to construct list of escaped chars
Speep-up the most frequent path by a factor 3 (block of non escaped chars)
CHANGELOG optimisation of html escaping (x3 speed and use less memory)