Fork me on GitHub
#yada
<
2017-11-30
>
frozenlock19:11:15

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...

dominicm19:11:04

what format are you sending it in?

frozenlock19:11:51

Tho I guess transit is possible

dominicm19:11:06

I know we have some code written somewhere to stream json

dominicm19:11:32

cheshire is streaming iirc.

dominicm19:11:51

I have no idea if yada/json does the right thing here.

frozenlock19:11:54

Does it mean it would start sending before it completed the formatting?

dominicm19:11:14

I think yada/json is actually wrong here, I remember seeing something and going "wtf? why would it do that!"

frozenlock19:11:26

Hmm... not multi threaded, but that might be even better.

frozenlock19:11:20

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.

dominicm19:11:18

I'd benchmark, as it might be the GC killing you or something related to the formatting itself.

dominicm19:11:36

(loading the whole thing into a string in memory might not be good for example)

danielcompton22:11:09

@frozenlock how big are you talking about? 1MB, 10MB, 100MB?