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

Remove large array type-specific performance optimisation #498

Merged
merged 1 commit into from
May 23, 2018

Conversation

erayd
Copy link
Contributor

@erayd erayd commented Mar 4, 2018

What

Why

Because the current implementation of this optimisation logic contains several serious bugs, and the project is short of maintainers. As this optimisation doesn't apply to most use-cases anyway, removing it completely and validating via the regular code path seems like the best option.

Fixes jsonrainbow#441.

The bug in jsonrainbow#441 was caused by refactoring of the optimisation which
introduced a type-checking error. Noting the performance impact is
negligible for all cases other than large arrays of strings or numbers,
and introduces significant cognitive complexity to a project that is
extremely short of maintainers, removing it seems like the best course
of action.

The performance improvement provided by this optimisation was
approximately 40%, however it also carried a number of other problematic
bugs - if it were to be reintroduced at a later date with those bugs
fixed (mainly the skipping of much of the validation logic for optimised
items, even in cases where that logic might be necessary), it would not
have such a significant impact.
@erayd erayd mentioned this pull request Mar 4, 2018
@shmax
Copy link
Collaborator

shmax commented Mar 4, 2018

👍

@erayd
Copy link
Contributor Author

erayd commented Mar 28, 2018

@bighappyface?

@bighappyface
Copy link
Collaborator

@erayd sorry for the silence.

Copy link
Collaborator

@bighappyface bighappyface left a comment

Choose a reason for hiding this comment

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

+1 for 0254213

@bighappyface bighappyface merged commit d30410c into jsonrainbow:master May 23, 2018
@erayd erayd deleted the bugfix-441 branch January 10, 2019 04:47
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.

3 participants