Skip to content

Commit 8337eca

Browse files
authored
Benchmark adding and rebuilding a 10k directory of schemas (#724)
Signed-off-by: Juan Cruz Viotti <[email protected]>
1 parent 4fc6247 commit 8337eca

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

benchmark/index.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,28 @@ echo "Measuring: cached rebuild (1001 existing)..." >&2
123123
RESULT_CACHED_1001="$(measure)"
124124
echo " Result: ${RESULT_CACHED_1001}ms" >&2
125125

126+
# Fill up to 10000 schemas
127+
echo "Filling registry to 10000 schemas..." >&2
128+
index=1001
129+
while [ "$index" -lt 10000 ]
130+
do
131+
generate_schema "schema-$index"
132+
index=$((index + 1))
133+
done
134+
echo "Reindexing outside measurements..." >&2
135+
"$INDEX" --skip-banner "$TMP/one.json" "$TMP/output" > /dev/null 2>&1
136+
137+
# Measure adding one schema (with a $ref) to a 10000-schema registry
138+
echo "Measuring: add one schema (10000 existing)..." >&2
139+
generate_schema_with_ref "schema-10000" "schema-0"
140+
RESULT_10000_TO_10001="$(measure)"
141+
echo " Result: ${RESULT_10000_TO_10001}ms" >&2
142+
143+
# Measure a fully cached rebuild (nothing changed, 10001 schemas)
144+
echo "Measuring: cached rebuild (10001 existing)..." >&2
145+
RESULT_CACHED_10001="$(measure)"
146+
echo " Result: ${RESULT_CACHED_10001}ms" >&2
147+
126148
cat << EOF
127149
[
128150
{
@@ -140,6 +162,11 @@ cat << EOF
140162
"unit": "ms",
141163
"value": $RESULT_1000_TO_1001
142164
},
165+
{
166+
"name": "Add one schema (10000 existing)",
167+
"unit": "ms",
168+
"value": $RESULT_10000_TO_10001
169+
},
143170
{
144171
"name": "Cached rebuild (1 existing)",
145172
"unit": "ms",
@@ -154,6 +181,11 @@ cat << EOF
154181
"name": "Cached rebuild (1001 existing)",
155182
"unit": "ms",
156183
"value": $RESULT_CACHED_1001
184+
},
185+
{
186+
"name": "Cached rebuild (10001 existing)",
187+
"unit": "ms",
188+
"value": $RESULT_CACHED_10001
157189
}
158190
]
159191
EOF

0 commit comments

Comments
 (0)