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

smarter number and string detection for Mojo::JSON #620

Merged
merged 5 commits into from
May 12, 2014
Merged

Conversation

kraih
Copy link
Member

@kraih kraih commented May 12, 2014

This version is a lot more DWIM and can handle a few more edge cases than our current B based code, such as dualvars and strings that have accidentally been used in numeric context. Only downside is that it needs to do more copies and is therefore a little slower. For example 100000 iterations of encode_json({foo => "bar" x 20000, baz => 23}) went from 27.398 to 29.621 seconds. I think a vote will have to decide if the change is worth it.

@kraih
Copy link
Member Author

kraih commented May 12, 2014

Looks like it might not work on Perl 5.10 and 5.12, we'll have to fix that first.

@kraih
Copy link
Member Author

kraih commented May 12, 2014

And fixed, it's also a little bit faster now at 28.161 seconds.

kraih added a commit that referenced this pull request May 12, 2014
smarter number and string detection for Mojo::JSON
@kraih kraih merged commit fc1819b into master May 12, 2014
@kraih kraih deleted the better_json branch June 20, 2014 17:14
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

Successfully merging this pull request may close these issues.

1 participant