Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: use 'fast-json-stringify' to encode span into a json #487

Open
lukiano opened this issue Feb 20, 2020 · 5 comments
Open

Comments

@lukiano
Copy link

lukiano commented Feb 20, 2020

Given that the span model is known, I was wondering if we could use a library like the one mentioned in the title.
For those unfamiliar with it, if a javascript object follow a known schema, by passing that schema to the library it will stringify the object much faster than plain JSON.stringify.

@jcchavezs
Copy link
Contributor

jcchavezs commented Feb 20, 2020 via email

@lukiano
Copy link
Author

lukiano commented Feb 20, 2020

I can try. I have to fetch the actual schema. I have some doubts on what's allowed on a tag.

@jcchavezs
Copy link
Contributor

jcchavezs commented Feb 20, 2020 via email

@lukiano
Copy link
Author

lukiano commented Feb 21, 2020

Currently blocked on fastify/fast-json-stringify#209

@lukiano
Copy link
Author

lukiano commented Feb 21, 2020

Processing the span on line

it('should transform correctly from Span to JSON representation', () => {
in a loop 10 million times gives the following results:

  • JSON.stringify: 13491 milliseconds
  • fast-json-stringify: 6611 milliseconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants