Is it worth the effort to try to reduce JSON size?

后端 未结 5 1956
遥遥无期
遥遥无期 2020-12-24 02:21

I am submitting relatively lots of data from a mobile application (up to 1000 JSON objects), that I would normally encode like this:

[{
    id: 12,
    score         


        
5条回答
  •  天涯浪人
    2020-12-24 02:55

    JSONH, aka hpack, https://github.com/WebReflection/JSONH does something very similar to your example:

    [{
        id: 12,
        score: 34,
        interval: 5678,
        sub: 9012
    }, {
        id: 98,
        score: 76,
        interval: 5432,
        sub: 1098
    }, ...]
    

    Would turn into:

    [["id","score","interval","sub"],12,34,5678,9012,98,76,5432,1098,...]
    

提交回复
热议问题