Skip to content

Commit efee881

Browse files
jberrymanhasura-bot
authored andcommitted
ENG-1227: mbs: reduce artifact size by omitting "default" values (#1323)
We get a 17% reduction in size for chinook.json, 14% for our big schema. Benchmark is 8% faster for chinook.json <!-- The PR description should answer 2 important questions: --> ### What reduce artifact size ### How remove certain common "default" fields on serialization, to be repopulated on deserialization. Since this works at the serde level we should still benefit if we manage to switch to e.g. bincode I attempted to create a macro for this, but decided it wasn't worth it. Fields were chosen by sorting and counting json fields, and adding these annotations for the heaviest ones. V3_GIT_ORIGIN_REV_ID: 4605016021fa6aafb97759e3bd5346116413a0ef
1 parent 70b158e commit efee881

File tree

34 files changed

+344
-339
lines changed

34 files changed

+344
-339
lines changed

Diff for: v3/Cargo.lock

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: v3/crates/graphql/frontend/tests/generate_ir/field_argument/expected.json

+2-13
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,13 @@
2020
"underlying_type": {
2121
"Named": {
2222
"Custom": {
23-
"subgraph": "default",
2423
"name": "int4"
2524
}
2625
}
27-
},
28-
"nullable": false
26+
}
2927
},
3028
"field_base_type_kind": "Scalar",
3129
"parent_type": {
32-
"subgraph": "default",
3330
"name": "Artist"
3431
},
3532
"argument_types": {},
@@ -70,7 +67,6 @@
7067
"underlying_type": {
7168
"Named": {
7269
"Custom": {
73-
"subgraph": "default",
7470
"name": "varchar"
7571
}
7672
}
@@ -79,15 +75,13 @@
7975
},
8076
"field_base_type_kind": "Scalar",
8177
"parent_type": {
82-
"subgraph": "default",
8378
"name": "Artist"
8479
},
8580
"argument_types": {
8681
"hash": {
8782
"underlying_type": {
8883
"Named": {
8984
"Custom": {
90-
"subgraph": "default",
9185
"name": "varchar"
9286
}
9387
}
@@ -137,7 +131,6 @@
137131
"model_selection": {
138132
"data_connector": {
139133
"name": {
140-
"subgraph": "default",
141134
"name": "db"
142135
},
143136
"url": {
@@ -149,10 +142,7 @@
149142
"capabilities": {
150143
"supported_ndc_version": "V01",
151144
"supports_explaining_queries": true,
152-
"supports_explaining_mutations": false,
153-
"supports_nested_object_filtering": true,
154-
"supports_nested_object_aggregations": false,
155-
"supports_nested_array_filtering": false
145+
"supports_nested_object_filtering": true
156146
}
157147
},
158148
"collection": "Artist",
@@ -209,7 +199,6 @@
209199
"models_used": [
210200
{
211201
"model": {
212-
"subgraph": "default",
213202
"name": "Artist"
214203
},
215204
"count": 1

Diff for: v3/crates/graphql/frontend/tests/generate_ir/get_by_id/expected.json

+3-12
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@
2121
"Named": {
2222
"Inbuilt": "Int"
2323
}
24-
},
25-
"nullable": false
24+
}
2625
},
2726
"field_base_type_kind": "Scalar",
2827
"parent_type": {
29-
"subgraph": "default",
3028
"name": "article"
3129
},
3230
"argument_types": {},
@@ -68,12 +66,10 @@
6866
"Named": {
6967
"Inbuilt": "String"
7068
}
71-
},
72-
"nullable": false
69+
}
7370
},
7471
"field_base_type_kind": "Scalar",
7572
"parent_type": {
76-
"subgraph": "default",
7773
"name": "article"
7874
},
7975
"argument_types": {},
@@ -106,7 +102,6 @@
106102
"model_selection": {
107103
"data_connector": {
108104
"name": {
109-
"subgraph": "default",
110105
"name": "db"
111106
},
112107
"url": {
@@ -118,10 +113,7 @@
118113
"capabilities": {
119114
"supported_ndc_version": "V01",
120115
"supports_explaining_queries": true,
121-
"supports_explaining_mutations": false,
122-
"supports_nested_object_filtering": true,
123-
"supports_nested_object_aggregations": false,
124-
"supports_nested_array_filtering": false
116+
"supports_nested_object_filtering": true
125117
}
126118
},
127119
"collection": "article",
@@ -184,7 +176,6 @@
184176
"models_used": [
185177
{
186178
"model": {
187-
"subgraph": "default",
188179
"name": "Articles"
189180
},
190181
"count": 1

Diff for: v3/crates/graphql/frontend/tests/generate_ir/get_many/expected.json

+2-9
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,10 @@
5353
"Named": {
5454
"Inbuilt": "String"
5555
}
56-
},
57-
"nullable": false
56+
}
5857
},
5958
"field_base_type_kind": "Scalar",
6059
"parent_type": {
61-
"subgraph": "default",
6260
"name": "article"
6361
},
6462
"argument_types": {},
@@ -91,7 +89,6 @@
9189
"model_selection": {
9290
"data_connector": {
9391
"name": {
94-
"subgraph": "default",
9592
"name": "db"
9693
},
9794
"url": {
@@ -103,10 +100,7 @@
103100
"capabilities": {
104101
"supported_ndc_version": "V01",
105102
"supports_explaining_queries": true,
106-
"supports_explaining_mutations": false,
107-
"supports_nested_object_filtering": true,
108-
"supports_nested_object_aggregations": false,
109-
"supports_nested_array_filtering": false
103+
"supports_nested_object_filtering": true
110104
}
111105
},
112106
"collection": "article",
@@ -157,7 +151,6 @@
157151
"models_used": [
158152
{
159153
"model": {
160-
"subgraph": "default",
161154
"name": "Articles"
162155
},
163156
"count": 1

0 commit comments

Comments
 (0)