Former-commit-id:133dc97f67
[formerlya02aeb236c
] [formerly9f19e3f712
] [formerly133dc97f67
[formerlya02aeb236c
] [formerly9f19e3f712
] [formerly06a8b51d6d
[formerly9f19e3f712
[formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]]] Former-commit-id:06a8b51d6d
Former-commit-id:9bb8decbcf
[formerly8e80217e59
] [formerly377dcd10b9
[formerly3360eb6c5f
]] Former-commit-id:377dcd10b9
Former-commit-id:e2ecdcfe33
42 lines
No EOL
1.1 KiB
Python
42 lines
No EOL
1.1 KiB
Python
|
|
import pypies
|
|
from timeit import Timer
|
|
ntrials = 10
|
|
|
|
def readObject():
|
|
f = open('/tmp/javaOut')
|
|
data = f.read()
|
|
f.close()
|
|
return data
|
|
|
|
def deserialize(data):
|
|
dsm = pypies.DynamicSerializationManager.DynamicSerializationManager()
|
|
obj = dsm.deserializeBytes(data)
|
|
return obj
|
|
|
|
def main():
|
|
timer = Timer("deserialize(data)", "from __main__ import deserialize, readObject; data = readObject()")
|
|
print "deserializing took", sum(timer.repeat(ntrials,1))/ntrials,'seconds'
|
|
obj = readObject()
|
|
b = deserialize(obj)
|
|
printout(b)
|
|
|
|
def printout(obj):
|
|
print "result", obj
|
|
print "groupName", obj.getGroupName()
|
|
print "size", obj.getSize()
|
|
print "otherName", obj.getOtherName()
|
|
print "nullTest", obj.getNullTest()
|
|
print "getValue", obj.getValue()
|
|
print "good", obj.getGood()
|
|
print "floatValue", obj.getFloatValue()
|
|
print "floatArray", obj.getFloatArray()
|
|
print "intArray", obj.getIntArray()
|
|
print "testMap", obj.getTestMap()
|
|
print "testSet", obj.getTestSet()
|
|
print "someEnum", obj.getSomeEnum()
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main() |