Project

General

Profile

« Previous | Next » 

Revision 0a29dc87

Added by k0kubun (Takashi Kokubun) over 6 years ago

Optimize CGI.escapeHTML by reducing buffer extension

and switch-case branches.

Buffer allocation optimization using ALLOCA_N would be the main
benefit of patch. It eliminates the O(N) buffer extensions.

It also reduces the number of branches using escape table like
https://mattn.kaoriya.net/software/lang/c/20160817011915.htm.

Closes: https://github.com/ruby/ruby/pull/2226

Co-authored-by: Nobuyoshi Nakada
Co-authored-by: Yasuhiro MATSUMOTO