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

add support for bigint #970

Closed
wants to merge 7 commits into from
Closed

Conversation

alexey-sh
Copy link

No description provided.

Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is at a minimum missing tests.

@mcollina
Copy link
Member

I'm not sure we should land this as JSON.stringify() does not support this correctly either.

@alexey-sh
Copy link
Author

alexey-sh commented Feb 17, 2021

@mcollina

I'm not sure we should land this as JSON.stringify() does not support this correctly either.

I'm not sure there is a way to make it faster than JSON.stringify.

@alexey-sh
Copy link
Author

alexey-sh commented Feb 17, 2021

@jsumners

This is at a minimum missing tests.

I added some tests. Please have a look

test/basic.test.js Outdated Show resolved Hide resolved
test/basic.test.js Outdated Show resolved Hide resolved
pid,
hostname,
level: 30,
msg: 'foo 1',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why doesn't this have the n suffix?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh idk. is it important? would you like me to add the suffix?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other outputs in this PR have the suffix. I'm asking about it from a consistency standpoint. How will an interpreter know that it is a BigInt without the suffix?

@jsumners
Copy link
Member

Current master branch bench
Running DEEP-OBJECT benchmark

benchPinoDeepObj*10000: 3801.850ms
benchPinoAsyncDeepObj*10000: 3609.519ms
benchPinoNodeStreamDeepObj*10000: 4111.749ms
PR branch bench
Running DEEP-OBJECT benchmark

benchPinoDeepObj*10000: 4437.022ms
benchPinoAsyncDeepObj*10000: 4350.699ms
benchPinoNodeStreamDeepObj*10000: 4622.513ms

return value.toString() + 'n'
}
return value
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to slow us down significanfly. I'm -1 to us landing this feature.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deep object benchmarks confirm this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to slow us down significanfly.

have you checked the case then JSON.strigify throws an error? I bet it goes down a lot.

I'm -1 to us landing this feature.

and -{a lot of users} because luck of bigint support.

––––

I guess it's possible to cofigure pino to skip bigint check. does it sound fine for you guys?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request. We have had a discussion and have determined that BigInt needs better support in general. This implementation negatively impacts our benchmarks even when a BigInt is not present.

alexey-sh and others added 2 commits February 17, 2021 18:47
PR suggestion

Co-authored-by: James Sumners <james@sumners.email>
PR suggestion

Co-authored-by: James Sumners <james@sumners.email>
@jsumners jsumners closed this Feb 17, 2021
@pinojs pinojs locked as too heated and limited conversation to collaborators Feb 17, 2021
@alexey-sh alexey-sh deleted the fix/bigint_support branch February 18, 2021 16:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants