zlacker

[parent] [thread] 4 comments
1. akx+(OP)[view] [source] 2022-10-20 08:18:47
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...
replies(2): >>polski+Ca >>levkk+Qk1
2. polski+Ca[view] [source] 2022-10-20 10:25:00
>>akx+(OP)
asking as a person that does not use Python every day - what would be a better solution here?
replies(1): >>manfre+1g
◧◩
3. manfre+1g[view] [source] [discussion] 2022-10-20 11:23:19
>>polski+Ca
request.json is converting the request payload from a str to a dict. json.dumps converts it back to a str.
4. levkk+Qk1[view] [source] 2022-10-20 16:37:13
>>akx+(OP)
If I turn that into a single line and that improves performance 40x... I will probably not do engineering for a while after that.
replies(1): >>learnd+Lm2
◧◩
5. learnd+Lm2[view] [source] [discussion] 2022-10-20 21:38:27
>>levkk+Qk1
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.
[go to top]