I have a very big map to transmit to the browser. Is there a way to make use of multiple cores when formatting the data? As it is I have 1 CPU going to 100% for a few seconds...
what format are you sending it in?
json
Tho I guess transit is possible
I know we have some code written somewhere to stream json
cheshire is streaming iirc.
I have no idea if yada/json does the right thing here.
Does it mean it would start sending before it completed the formatting?
yes
I think yada/json is actually wrong here, I remember seeing something and going "wtf? why would it do that!"
Hmm... not multi threaded, but that might be even better.
I mean : I don't know if it's single thread yet, but it would be better than simply doing everything in multiple threads and THEN sending it.
I'd benchmark, as it might be the GC killing you or something related to the formatting itself.
(loading the whole thing into a string in memory might not be good for example)
for sure
@frozenlock how big are you talking about? 1MB, 10MB, 100MB?
@danielcompton 10-100MB