3 ms·
Including the output of py2many --mojo=1 test.py here for completeness. The generated code didn't run out of the box. Slightly modified below: from python
by adsharma 2y ago
Including the output of py2many --mojo=1 test.py here for completeness.
The generated code didn't run out of the box. Slightly modified below:
from python import Python
fn main() raises:
var json = Python.import_module("json")
for i in range(100000):
var file = open("test.json", "r").read()
var data = json.loads(file)
var wealth_str = data["user"]["wealth"]
var wealth = Float64(wealth_str)
print("OK")
Not much faster:
# time -p ./test
OK
real 1.69
user 1.16
sys 0.40
But you get a small shippable binary:
# du -sh test
4.1M test