Hacker News new | ask | show | jobs
by akx 1340 days ago
A good start would be to not do silly things like

    body = request.json
    key = json.dumps(body)
in the prediction code to begin with: https://github.com/postgresml/postgresml/blob/15c8488ade86b0...
2 comments

If I turn that into a single line and that improves performance 40x... I will probably not do engineering for a while after that.
The parent comment said it would be "a good start". It's like adding sleep(1000) to a benchmark to purposely make it look worse than your own product.
asking as a person that does not use Python every day - what would be a better solution here?
request.json is converting the request payload from a str to a dict. json.dumps converts it back to a str.