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

Standardized parsing errors #1227

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from
Draft

Standardized parsing errors #1227

wants to merge 4 commits into from

Conversation

LJNeon
Copy link
Contributor

@LJNeon LJNeon commented Jun 25, 2021

As far as I know, the main cases where this code throws are Discord outages and internet problems. In both cases (and I presume in any case really), the actual syntax error is irrelevant. Adding a standard prefix to the error message is already done for zlib errors a few lines above, and makes it easier to determine the actual error.

Copy link
Collaborator

@bsian03 bsian03 left a comment

Choose a reason for hiding this comment

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

The return behaviour L2186/2190 is inconsistent, doesn't matter but would be nice if both do the "same thing"

@LJNeon
Copy link
Contributor Author

LJNeon commented Jun 25, 2021

The goal was to make L2186 consistent with the zlib parsing error above. I would say making those "both do the same thing" as you put it makes more sense to me considering they're very similar errors, compared to a different return statement at the bottom.

@abalabahaha
Copy link
Owner

Did we figure out the performance impact of this?

@LJNeon
Copy link
Contributor Author

LJNeon commented Aug 19, 2021

Did we figure out the performance impact of this?

Ran a quick test and it seems like the impact is around ~30% for just the parsing code. Doesn't seem to make a noticeable difference to the overall function's performance.

What I did for the test was add some process.hrtime.bigint() calls to the function and calculate averages after bringing a small test bot online for a few minutes and giving it events. Probably not perfect but I figure that's a real-world-ish test.

@abalabahaha abalabahaha marked this pull request as draft June 29, 2022 16:01
Jam-Manbo pushed a commit to Manbo-js/manbo that referenced this pull request Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants