valyala / fastjson

Fast JSON parser and validator for Go. No custom structs, no code generation, no reflection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pls provide examples and numbers in bytes for the memory usage meaning

hiqsociety opened this issue · comments

  1. this statement doesnt really say a lot. what's inputJSON?

fastjson requires up to sizeof(Value) * len(inputJSON) bytes of memory for parsing inputJSON string. Limit the maximum size of the inputJSON before parsing it in order to limit the maximum memory usage.

  1. i would like to use fastjson as replacement for "very large map" (10 mil maybe?) of 1024bytes key and 64kb value is this advisable?
    how much memory will this take?

  2. if i add 10 mil 65kb items (key and value) and delete ALL 10 mil items, will the memory usage shrink? just curious.