huge.py

Peter Amstutz, 04/27/2017 08:37 PM

 
1
import arvados
2
import time
3
import json
4

    
5
api = arvados.api('v1')
6

    
7
t = time.time()
8
pr = {}
9
for i in xrange(1, 200000):
10
    pr[str(i)] = {"foo": "bar", "baz": "quux"}
11
#pr = "\n".join('"%s": {"foo": "bar", "baz": "quux"}' % i for i in xrange(1, 200000))
12
print time.time()-t
13

    
14
print "payload about", len(json.dumps(pr))
15

    
16
t = time.time()
17
c = api.humans().create(body={"human": {"properties": {"p": pr}}}).execute()
18
print time.time()-t
19

    
20
print c["uuid"]
21

    
22
t = time.time()
23
api.humans().get(uuid=c["uuid"]).execute()
24
print time.time()-t