Skip to content

reduce payload size further #745

Open
@leeoniya

Description

@leeoniya

low hanging fruit:

  1. enable gzip
  2. optimize JSON structure

current structure:

{
  "commits": [
    [1594068256, "8981dbbc36f1575b0a417b6849767bde29e7c6b4"],
    [1594083404, "70f9d23b916f2db7da711aa4a0317a218997ba42"],
  ],
  "benchmarks": {
    "regression-31157": {                       // benchName
      "check": {                                    // buildKind
        "full": {                                        // cacheState
            "is_interpolated": [122,23,523, ...],
            "points": [719798144, 719807680, ...],
        }
      }
    },
  }
}

this is still wasteful, since is_interpolated appears to be shared across the entire benchName, so moving it up 2 levels will significantly reduce duplication in both keys and values. something like:

{
  "commits": [
    [1594068256, "8981dbbc36f1575b0a417b6849767bde29e7c6b4"],
    [1594083404, "70f9d23b916f2db7da711aa4a0317a218997ba42"],
  ],
  "benchmarks": {
    "regression-31157": {                       // benchName
      "interpolated": [122,23,523, ...],
      "kinds": {
        "check": {                                    // buildKind
          "full": [719798144, 719807680, ...]             // cacheState: y-values
        }
      }
    }
  }
}

even smaller would be to squash "kinds" level and just skip "interpolated" in the buildKind/for-in loop. i'm size/perf obsessed, so i'd personally go for this:

{
  "commits": [
    [1594068256, "8981dbbc36f1575b0a417b6849767bde29e7c6b4"],
    [1594083404, "70f9d23b916f2db7da711aa4a0317a218997ba42"],
  ],
  "benchmarks": {
    "regression-31157": {                       // benchName
      "interpolated": [122,23,523, ...],
      "check": {                                    // buildKind
        "full": [719798144, 719807680, ...]             // cacheState: y-values
      }
    }
  }
}

cc @Mark-Simulacrum

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-apiIssues related to the API exposed by the site

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions