Skip to content

Serialize AssetId by identity. #3970

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

Merged
merged 1 commit into from
Apr 11, 2025

Conversation

davidmorgan
Copy link
Contributor

@davidmorgan davidmorgan commented Apr 11, 2025

For #3811.

Serialize AssetId by identity, with a separate list of values.

Remove some unused/old code that was the old way of doing something similar.

This significantly reduces the graph size, but is still not the final state: next step after this is to keep input sets as trees, and serialize those as trees and by identity.

Benchmarks

Before this PR

with this PR
json_serializable
shape,libraries,clean/ms,no changes/ms,incremental/ms,json/KiB
loop,1,23492,3887,5292,417
loop,100,23786,3900,6928,2564
loop,250,27987,4494,9667,12674
loop,500,32715,5789,16602,47884
loop,750,37391,8292,22735,106042
loop,1000,43723,11432,30665,191073
forwards,1,22246,3762,5264,417
forwards,100,24092,3960,7265,1741
forwards,250,27831,4231,9800,7467
forwards,500,29865,5024,14991,26973
forwards,750,36458,6234,20061,58929
forwards,1000,39756,8070,28756,105307
backwards,1,22162,3845,5364,417
backwards,100,24036,4054,7900,1762
backwards,250,27503,4349,10938,7594
backwards,500,31306,5024,15695,27471
backwards,750,37975,6045,22651,60042
backwards,1000,43777,8021,27442,107280

after

json_serializable
shape,libraries,clean/ms,no changes/ms,incremental/ms,json/KiB
loop,1,23153,3936,5187,339
loop,100,24380,4026,7118,702
loop,250,26753,4199,10192,1982
loop,500,32433,4526,14631,6068
loop,750,35511,5059,19585,12595
loop,1000,41457,5664,26464,21574
forwards,1,23234,3912,5161,339
forwards,100,25944,4070,7481,609
forwards,250,26586,3938,9369,1383
forwards,500,32053,4194,14056,3649
forwards,750,35001,4608,18724,7135
forwards,1000,40243,5003,23503,11853
backwards,1,23745,3929,5077,339
backwards,100,25092,3977,7655,605
backwards,250,27593,4057,10292,1373
backwards,500,33167,4189,15592,3628
backwards,750,38389,4721,19006,7105
backwards,1000,43074,5071,25351,11810

Copy link

github-actions bot commented Apr 11, 2025

PR Health

@davidmorgan davidmorgan force-pushed the identity-serializer branch from 0f3a028 to 91a58ff Compare April 11, 2025 12:40
@davidmorgan davidmorgan marked this pull request as ready for review April 11, 2025 12:53
@davidmorgan davidmorgan requested a review from jensjoha April 11, 2025 12:54
@davidmorgan davidmorgan merged commit 464e9f2 into dart-lang:master Apr 11, 2025
74 of 75 checks passed
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.

2 participants