Skip to content

Conversation

nicoburns
Copy link
Contributor

@nicoburns nicoburns commented Jul 17, 2025

This changes the scores.json format in preparation for #50 (rewrite score calculation in Rust). The main change is to replace the use of a heterogeneous array (mix of strings and objects) with a keyed object and a nested array. The new format is easier to serialize/deserialize using serde (and IMO makes more sense in JS anyway).

Corresponding servo.org PR (should be merged at same time): servo/servo.org#241

before:

[
    "2025-07-17",
    "1c4797809",
    "0.0.1-f70a4eb4f",
    {
      "total_tests": 46787,
      "total_score": 29447.8764608724,
      "total_subtests": 1854463,
      "total_subtests_passed": 1722785
    },
    {
      "total_tests": 809,
      "total_score": 502.872027417027,
      "total_subtests": 3659,
      "total_subtests_passed": 2186
    },
    ...
]

After:

{
        "date": "2025-07-17",
        "wpt_revision": "1c4797809",
        "servo_revision": "0.0.1-f70a4eb4f",
        "scores":
        [
            {
                "total_tests": 46787,
                "total_score": 29447.876460872423,
                "total_subtests": 1854463,
                "total_subtests_passed": 1722785
            },
            {
                "total_tests": 809,
                "total_score": 502.8720274170274,
                "total_subtests": 3659,
                "total_subtests_passed": 2186
            },
            ...
        ]
}

@nicoburns nicoburns force-pushed the object-for-score-entry branch from bec1da8 to 9036ad8 Compare July 17, 2025 23:30
@nicoburns nicoburns mentioned this pull request Jul 18, 2025
12 tasks
Copy link
Member

@mukilan mukilan left a comment

Choose a reason for hiding this comment

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

I'm curious to know what is the new size of the scores.json. Hopefully, the gzip compression on server side still helps.

@nicoburns
Copy link
Contributor Author

I'm curious to know what is the new size of the scores.json

The new file is 2147kb compared to 2107kb for the old file. GZIP compression is reducing the old files to 76.7kb, and I'd expect the new changes to also compress well as they're adding a single repeated string.

@nicoburns nicoburns merged commit db2b77e into main Jul 18, 2025
@nicoburns
Copy link
Contributor Author

New gzipped size is 77.3kb

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.

2 participants