> On Apr 25, 2022, at 1:27 PM, David Blevins <david.blev...@gmail.com> wrote:
> 
>> On Apr 25, 2022, at 12:23 PM, Romain Manni-Bucau <rmannibu...@gmail.com> 
>> wrote:
>> 
>> Oh, got it, thanks for re-explaining.
>> 
>> Did you try a simple heuristic on visiting to estimate the size (3 chars
>> for a number, no escaping for string, just length etc...), should enable to
>> cut fast enough the visiting without hacking lower level any buffer
>> strategy or buffer nor calling flush and moving the array data too often?
>> Otherwise we can do a custom generator factory from the provider in mapper
>> propagting properties but Im less a fan of that option cause it complexify
>> the user customization of the generator (today we can output other stuff
>> than json through that way).
> 
> The most optimized solution I can image is setting the buffer size of 
> JsonGeneratorImpl to the snippet size, then adding an option to 
> JsonGeneratorImpl so that it can be told to call flush() on the Writer when 
> it reaches its buffer limit.

If we're being honest with ourselves here as well, copying the config map and 
updating it is likely to itself add more array copies, object reference 
updates, iterating over bytes in strings used as keys during map inserts, etc.


-David

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to