Skip to content

Commit 990edcd

Browse files
committed
Tweak example
The measured time of the first experiment tend to contain ovehead. It makes `num_worker=1` appear out of the trend. This commit reverses the order of num_workers, so that the effect is absorbed in `num_worker=32`.
1 parent 9cc0e5e commit 990edcd

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

examples/data_formats.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def main() -> None:
211211
src = DataSource(get_mock_data(data_format, compressed), repeat=1000)
212212
load_fn = _get_load_fn(data_format, impl)
213213
for mode in ["mp", "mt"]:
214-
for num_workers in [1, 2, 4, 8, 16, 32]:
214+
for num_workers in [32, 16, 8, 4, 2, 1]:
215215
pipeline = get_pipeline(
216216
src, # pyre-ignore: [6]
217217
load_fn,
@@ -220,7 +220,9 @@ def main() -> None:
220220
)
221221
num_items, elapsed = run_pipeline(pipeline)
222222
qps = num_items / elapsed
223-
print(f"{data_format},{compressed},{impl},{mode},{num_workers},{qps}")
223+
print(
224+
f"{data_format},{compressed},{impl},{mode},{num_workers},{qps:.1f}"
225+
)
224226

225227

226228
if __name__ == "__main__":

0 commit comments

Comments
 (0)