1
1
"""This is the script for `ray microbenchmark`."""
2
2
3
3
import asyncio
4
+ import json
4
5
import logging
5
6
import os
6
7
import time
@@ -108,10 +109,13 @@ def main():
108
109
check_optimized_build ()
109
110
110
111
print ("Tip: set TESTS_TO_RUN='pattern' to run a subset of benchmarks" )
111
- ray .init ()
112
+
113
+ ray .init (
114
+ _internal_config = json .dumps ({
115
+ "put_small_object_in_memory_store" : True
116
+ }))
112
117
113
118
value = ray .put (0 )
114
- arr = np .zeros (100 * 1024 * 1024 , dtype = np .int64 )
115
119
116
120
def get_small ():
117
121
ray .get (value )
@@ -123,11 +127,6 @@ def put_small():
123
127
124
128
timeit ("single client put calls" , put_small )
125
129
126
- def put_large ():
127
- ray .put (arr )
128
-
129
- timeit ("single client put gigabytes" , put_large , 8 * 0.1 )
130
-
131
130
@ray .remote
132
131
def do_put_small ():
133
132
for _ in range (100 ):
@@ -138,6 +137,26 @@ def put_multi_small():
138
137
139
138
timeit ("multi client put calls" , put_multi_small , 1000 )
140
139
140
+ ray .shutdown ()
141
+ ray .init (
142
+ _internal_config = json .dumps ({
143
+ "put_small_object_in_memory_store" : False
144
+ }))
145
+
146
+ value = ray .put (0 )
147
+ arr = np .zeros (100 * 1024 * 1024 , dtype = np .int64 )
148
+
149
+ timeit ("single client get calls (Plasma Store)" , get_small )
150
+
151
+ timeit ("single client put calls (Plasma Store)" , put_small )
152
+
153
+ timeit ("multi client put calls (Plasma Store)" , put_multi_small , 1000 )
154
+
155
+ def put_large ():
156
+ ray .put (arr )
157
+
158
+ timeit ("single client put gigabytes" , put_large , 8 * 0.1 )
159
+
141
160
@ray .remote
142
161
def do_put ():
143
162
for _ in range (10 ):
0 commit comments