Skip to content

Disallow missing commas between fields (#2287 #2520) #2889

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

alisa101rs
Copy link

@alisa101rs alisa101rs commented Dec 17, 2024

Fixes #2287 and #2520, makes sure that comma between key-value pairs is required in Json.decodeFromString

@alisa101rs alisa101rs changed the base branch from master to dev December 17, 2024 04:20
@alisa101rs alisa101rs changed the title Disallow missing commas between fields (#2287) Disallow missing commas between fields (#2287 #2520) Dec 17, 2024
@alisa101rs
Copy link
Author

Hi @sandwwraith, could you please take a look at failed build? I believe it's not caused by this PR and I shouldn't/can't fix it in this PR

@sandwwraith
Copy link
Member

Sure, I'll restart the build

Copy link
Member

@sandwwraith sandwwraith left a comment

Choose a reason for hiding this comment

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

Hi! Thanks for the great PR! I love the idea overall, but I have several comments on implementation.

@sandwwraith
Copy link
Member

Just a quick update from me: I've reviewed the PR and I'm mostly satisfied with the changes. However, I also ran the decoding benchmarks and unfortunately, scores for them dropped for about 6-8%:

develop
====

Benchmark                                                   Mode  Cnt     Score    Error  Units
TwitterFeedBenchmark.decodeMicroTwitter                    thrpt   14   962.120 ± 34.369  ops/s
TwitterFeedBenchmark.decodeMicroTwitterNoAltNames          thrpt   14  1005.670 ± 43.361  ops/s
TwitterFeedBenchmark.decodeMicroTwitterWithNamingStrategy  thrpt   14   915.170 ± 10.127  ops/s
TwitterFeedBenchmark.decodeTwitter                         thrpt   14  1073.797 ± 51.738  ops/s
TwitterFeedBenchmark.decodeTwitterNoAltNames               thrpt   14  1090.153 ±  3.413  ops/s
TwitterFeedBenchmark.decodeTwitterWithNamingStrategy       thrpt   14   928.378 ±  3.961  ops/s


this PR
====
Benchmark                                                   Mode  Cnt     Score    Error  Units
TwitterFeedBenchmark.decodeMicroTwitter                    thrpt   14   885.924 ± 27.029  ops/s
TwitterFeedBenchmark.decodeMicroTwitterNoAltNames          thrpt   14   968.884 ±  7.501  ops/s
TwitterFeedBenchmark.decodeMicroTwitterWithNamingStrategy  thrpt   14   865.704 ± 17.647  ops/s
TwitterFeedBenchmark.decodeTwitter                         thrpt   14  1013.502 ± 14.582  ops/s
TwitterFeedBenchmark.decodeTwitterNoAltNames               thrpt   14   983.525 ± 48.605  ops/s
TwitterFeedBenchmark.decodeTwitterWithNamingStrategy       thrpt   14   871.941 ±  9.046  ops/s

I will try to investigate whether it is possible to restructure some changes to optimize it further or if we have to accept this performance hit for the sake of correctness.

@alisa101rs
Copy link
Author

alisa101rs commented Jan 22, 2025

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

Successfully merging this pull request may close these issues.

2 participants