From 8bdc6d233e54b93d19a98b85b2c173c08c13f04a Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sat, 20 Aug 2011 17:49:14 -0700 Subject: [PATCH] Prime the decoder buf for modest perf improvement on small messages. --- upb/pb/decoder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/upb/pb/decoder.c b/upb/pb/decoder.c index a8ddf170d4..4521ce25a0 100644 --- a/upb/pb/decoder.c +++ b/upb/pb/decoder.c @@ -369,6 +369,8 @@ void upb_decoder_decode(upb_decoder *d, upb_status *status) { } d->status = status; upb_dispatch_startmsg(&d->dispatcher); + // Prime the buf so we can hit the JIT immediately. + upb_trypullbuf(d); while(1) { // Main loop: executed once per tag/field pair. upb_decoder_checkdelim(d); upb_decoder_enterjit(d);