From 864ffa9dadd356762192ecacd2cda65eefcdfe19 Mon Sep 17 00:00:00 2001 From: Gabriel Lafond-Thenaille Date: Thu, 5 Dec 2024 15:19:44 +0100 Subject: [PATCH] json: increase read buffer size on the json parser * Force the size of the `YY_READ_BUF_SIZE` to `1 << 22` and the size of `YY_BUF_SIZE` to `YY_READ_BUF_SIZE * 2`. --- modules/demux/json/lexicon.l | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/demux/json/lexicon.l b/modules/demux/json/lexicon.l index 5f5105474d..3a15fcf878 100644 --- a/modules/demux/json/lexicon.l +++ b/modules/demux/json/lexicon.l @@ -41,6 +41,13 @@ result = (len > 0) ? len : YY_NULL; \ } +/** Forcing the size of the lexer's read buffer to speedup the json parsing */ +#define YY_READ_BUF_SIZE (1 << 18) +#ifdef YY_BUF_SIZE +# undef YY_BUF_SIZE +#endif +#define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) + %} %%