Skip to content

Commit 1ade1ea

Browse files
authored
Merge pull request #522 from mstange/no-implementation-column
Reduce JSON size some more by removing the implementation column and using 0 instead of null in the innerWindowID column
2 parents 4f85bd9 + d34dd93 commit 1ade1ea

File tree

4 files changed

+30
-76
lines changed

4 files changed

+30
-76
lines changed

fxprof-processed-profile/src/frame_table.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ impl Serialize for FrameTable {
109109
map.serialize_entry("subcategory", &self.subcategories)?;
110110
map.serialize_entry("func", &self.funcs)?;
111111
map.serialize_entry("nativeSymbol", &self.native_symbols)?;
112-
map.serialize_entry("innerWindowID", &SerializableSingleValueColumn((), len))?;
113-
map.serialize_entry("implementation", &SerializableSingleValueColumn((), len))?;
112+
map.serialize_entry("innerWindowID", &SerializableSingleValueColumn(0, len))?;
114113
map.serialize_entry("line", &SerializableSingleValueColumn((), len))?;
115114
map.serialize_entry("column", &SerializableSingleValueColumn((), len))?;
116115
map.end()

fxprof-processed-profile/src/markers.rs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,10 @@ impl InternalMarkerSchema {
738738
if let Some(label) = &self.table_label {
739739
map.serialize_entry("tableLabel", label)?;
740740
}
741-
map.serialize_entry("data", &SerializableSchemaFields(self))?;
741+
if let Some(description) = &self.description {
742+
map.serialize_entry("description", description)?;
743+
}
744+
map.serialize_entry("fields", &SerializableSchemaFields(self))?;
742745
if !self.graphs.is_empty() {
743746
map.serialize_entry("graphs", &self.graphs)?;
744747
}
@@ -753,9 +756,6 @@ impl InternalMarkerSchema {
753756
for field in &self.fields {
754757
seq.serialize_element(&SerializableSchemaField(field))?;
755758
}
756-
if let Some(description) = &self.description {
757-
seq.serialize_element(&SerializableDescriptionStaticField(description))?;
758-
}
759759
seq.end()
760760
}
761761
}
@@ -800,20 +800,6 @@ impl Serialize for SerializableSchemaField<'_> {
800800
}
801801
}
802802

803-
struct SerializableDescriptionStaticField<'a>(&'a str);
804-
805-
impl Serialize for SerializableDescriptionStaticField<'_> {
806-
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
807-
where
808-
S: serde::Serializer,
809-
{
810-
let mut map = serializer.serialize_map(None)?;
811-
map.serialize_entry("label", "Description")?;
812-
map.serialize_entry("value", self.0)?;
813-
map.end()
814-
}
815-
}
816-
817803
struct SerializableSchemaDisplay(MarkerLocations);
818804

819805
impl Serialize for SerializableSchemaDisplay {

fxprof-processed-profile/src/profile.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ impl Serialize for SerializableProfileMeta<'_> {
10421042
}),
10431043
)?;
10441044
map.serialize_entry("interval", &(self.0.interval.as_secs_f64() * 1000.0))?;
1045-
map.serialize_entry("preprocessedProfileVersion", &53)?;
1045+
map.serialize_entry("preprocessedProfileVersion", &55)?;
10461046
map.serialize_entry("processType", &0)?;
10471047
map.serialize_entry("product", &self.0.product)?;
10481048
if let Some(os_name) = &self.0.os_name {
@@ -1061,7 +1061,6 @@ impl Serialize for SerializableProfileMeta<'_> {
10611061
map.serialize_entry("pausedRanges", &[] as &[()])?;
10621062
map.serialize_entry("version", &24)?; // this version is ignored, only "preprocessedProfileVersion" is used
10631063
map.serialize_entry("usesOnlyOneStackType", &(!self.0.contains_js_function()))?;
1064-
map.serialize_entry("doesNotUseFrameImplementation", &true)?;
10651064
map.serialize_entry("sourceCodeIsNotOnSearchfox", &true)?;
10661065

10671066
let mut marker_schemas: Vec<InternalMarkerSchema> = self.0.marker_schemas.clone();

fxprof-processed-profile/tests/integration_tests/main.rs

Lines changed: 24 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ fn profile_without_js() {
372372
"name": []
373373
},
374374
"interval": 1.0,
375-
"preprocessedProfileVersion": 53,
375+
"preprocessedProfileVersion": 55,
376376
"processType": 0,
377377
"product": "test",
378378
"oscpu": "macOS 14.4",
@@ -386,7 +386,6 @@ fn profile_without_js() {
386386
"pausedRanges": [],
387387
"version": 24,
388388
"usesOnlyOneStackType": true,
389-
"doesNotUseFrameImplementation": true,
390389
"sourceCodeIsNotOnSearchfox": true,
391390
"markerSchema": [
392391
{
@@ -397,7 +396,7 @@ fn profile_without_js() {
397396
],
398397
"chartLabel": "{marker.data.name}",
399398
"tableLabel": "{marker.name} - {marker.data.name}",
400-
"data": [
399+
"fields": [
401400
{
402401
"key": "name",
403402
"label": "Details",
@@ -420,7 +419,8 @@ fn profile_without_js() {
420419
}
421420
],
422421
"tooltipLabel": "Custom tooltip label",
423-
"data": [
422+
"description": "This is a test marker with a custom schema.",
423+
"fields": [
424424
{
425425
"key": "eventName",
426426
"label": "Event name",
@@ -445,10 +445,6 @@ fn profile_without_js() {
445445
"format": "duration",
446446
"searchable": true
447447
},
448-
{
449-
"label": "Description",
450-
"value": "This is a test marker with a custom schema."
451-
}
452448
]
453449
}
454450
]
@@ -586,40 +582,22 @@ fn profile_without_js() {
586582
2
587583
],
588584
"innerWindowID": [
589-
null,
590-
null,
591-
null,
592-
null,
593-
null,
594-
null,
595-
null,
596-
null,
597-
null,
598-
null,
599-
null,
600-
null,
601-
null,
602-
null,
603-
null,
604-
null
605-
],
606-
"implementation": [
607-
null,
608-
null,
609-
null,
610-
null,
611-
null,
612-
null,
613-
null,
614-
null,
615-
null,
616-
null,
617-
null,
618-
null,
619-
null,
620-
null,
621-
null,
622-
null
585+
0,
586+
0,
587+
0,
588+
0,
589+
0,
590+
0,
591+
0,
592+
0,
593+
0,
594+
0,
595+
0,
596+
0,
597+
0,
598+
0,
599+
0,
600+
0
623601
],
624602
"line": [
625603
null,
@@ -1078,7 +1056,7 @@ fn profile_with_js() {
10781056
"name": []
10791057
},
10801058
"interval": 1.0,
1081-
"preprocessedProfileVersion": 53,
1059+
"preprocessedProfileVersion": 55,
10821060
"processType": 0,
10831061
"product": "test with js",
10841062
"sampleUnits": {
@@ -1091,7 +1069,6 @@ fn profile_with_js() {
10911069
"pausedRanges": [],
10921070
"version": 24,
10931071
"usesOnlyOneStackType": false,
1094-
"doesNotUseFrameImplementation": true,
10951072
"sourceCodeIsNotOnSearchfox": true,
10961073
"markerSchema": []
10971074
},
@@ -1125,12 +1102,8 @@ fn profile_with_js() {
11251102
null
11261103
],
11271104
"innerWindowID": [
1128-
null,
1129-
null
1130-
],
1131-
"implementation": [
1132-
null,
1133-
null
1105+
0,
1106+
0
11341107
],
11351108
"line": [
11361109
null,
@@ -1338,7 +1311,7 @@ fn profile_counters_with_sorted_processes() {
13381311
"initialSelectedThreads": [0],
13391312
"initialVisibleThreads": [0],
13401313
"interval": 1.0,
1341-
"preprocessedProfileVersion": 53,
1314+
"preprocessedProfileVersion": 55,
13421315
"processType": 0,
13431316
"product": "test",
13441317
"sampleUnits": {
@@ -1351,7 +1324,6 @@ fn profile_counters_with_sorted_processes() {
13511324
"pausedRanges": [],
13521325
"version": 24,
13531326
"usesOnlyOneStackType": true,
1354-
"doesNotUseFrameImplementation": true,
13551327
"sourceCodeIsNotOnSearchfox": true,
13561328
"markerSchema": []
13571329
},
@@ -1367,7 +1339,6 @@ fn profile_counters_with_sorted_processes() {
13671339
"func": [],
13681340
"nativeSymbol": [],
13691341
"innerWindowID": [],
1370-
"implementation": [],
13711342
"line": [],
13721343
"column": []
13731344
},
@@ -1449,7 +1420,6 @@ fn profile_counters_with_sorted_processes() {
14491420
"func": [],
14501421
"nativeSymbol": [],
14511422
"innerWindowID": [],
1452-
"implementation": [],
14531423
"line": [],
14541424
"column": []
14551425
},

0 commit comments

Comments
 (0)