[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#953660: RFP: golang-github-valyala-fastjson -- fast JSON parser and validator for Go (library)



Package: wnpp
Severity: wishlist
Tags: patch

* Package name    : golang-github-valyala-fastjson
  Version         : 1.5.0
  Upstream Author : Aliaksandr Valialkin
* URL             : https://github.com/valyala/fastjson
* License         : Expat
  Programming Lang: Go
  Description     : fast JSON parser and validator for Go (library)

 No custom structs, no code generation, no reflection.
 .
 Features:
  * Fast. As usual, up to 15x faster than the standard encoding/json.
  * Parses arbitrary JSON without schema, reflection, struct magic and code
    generation contrary to easyjson.
  * Provides a simple API.
  * Outperforms jsonparser and gjson when accessing multiple unrelated fields,
    since fastjson parses the input JSON only once.
  * Validates the parsed JSON unlike jsonparser and gjson.
  * May quickly extract a part of the original JSON with
    Value.Get(...).MarshalTo and modify it with Del and Set functions.
  * May parse array containing values with distinct types (aka non-homogenous
    types). For instance, fastjson easily parses the following JSON array
    [123, "foo", [456], {"k": "v"}, null].
  * fastjson preserves the original order of object items when calling
    Object.Visit.
 .
 Known limitations:
  * Requies extra care to work with - references to certain objects
    recursively returned by Parser must be released before the next call to
    Parse.  Otherwise the program may work improperly. The same applies to
    objects returned by Arena.
  * Cannot parse JSON from io.Reader.
 .
 Security:
  * fastjson shouldn't crash or panic when parsing input strings specially
    crafted by an attacker. It must return error on invalid input JSON.
  * 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.


This is a required dependency for victoria-metrics.

Attached a tested and working packaging, where only the Uploaders, and
ITP bug need to be filled, and the packaging imported into git.

Thanks,
Guillem

Attachment: golang-github-valyala-fastjson_1.5.0-1.debian.tar.xz
Description: application/xz


Reply to: