Add plasma store benchmark for small objects (#9549)

This commit is contained in:
Siyuan (Ryans) Zhuang
2020-07-17 14:20:59 -07:00
committed by GitHub
parent 87630cf024
commit cba9545266
+26 -7
View File
@@ -1,6 +1,7 @@
"""This is the script for `ray microbenchmark`."""
import asyncio
import json
import logging
import os
import time
@@ -108,10 +109,13 @@ def main():
check_optimized_build()
print("Tip: set TESTS_TO_RUN='pattern' to run a subset of benchmarks")
ray.init()
ray.init(
_internal_config=json.dumps({
"put_small_object_in_memory_store": True
}))
value = ray.put(0)
arr = np.zeros(100 * 1024 * 1024, dtype=np.int64)
def get_small():
ray.get(value)
@@ -123,11 +127,6 @@ def main():
timeit("single client put calls", put_small)
def put_large():
ray.put(arr)
timeit("single client put gigabytes", put_large, 8 * 0.1)
@ray.remote
def do_put_small():
for _ in range(100):
@@ -138,6 +137,26 @@ def main():
timeit("multi client put calls", put_multi_small, 1000)
ray.shutdown()
ray.init(
_internal_config=json.dumps({
"put_small_object_in_memory_store": False
}))
value = ray.put(0)
arr = np.zeros(100 * 1024 * 1024, dtype=np.int64)
timeit("single client get calls (Plasma Store)", get_small)
timeit("single client put calls (Plasma Store)", put_small)
timeit("multi client put calls (Plasma Store)", put_multi_small, 1000)
def put_large():
ray.put(arr)
timeit("single client put gigabytes", put_large, 8 * 0.1)
@ray.remote
def do_put():
for _ in range(10):