Skip to content

Accept json=raw() directly to skip rawToChar step on JSON received from curl #35

@MichaelChirico

Description

@MichaelChirico

As identified in this Twitter thread:

https://twitter.com/michael_chirico/status/1280656819606548480

See this Gist:

https://gist.github.com/MichaelChirico/f5e09ab9f5f437bb0286e8a42941a3e1

The performance of fparse is already damn impressive, but let's see if we can't do a mite better 😎

JSON as raw can be retrieved like so:

gist = file.path(
  'https://gist.githubusercontent.com/MichaelChirico',
  'f5e09ab9f5f437bb0286e8a42941a3e1', 'raw',
  'ab5f767b54810b53b30841ffe7f614aa07a32be0', 'presto_json_return.R'
)
charToRaw(tail(readLines(gist), 1L))

IINM from C++ POV this raw vector should just be a subset of a character vector...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions