zlacker

[return to "PostgresML is 8-40x faster than Python HTTP microservices"]
1. learnd+Mk[view] [source] 2022-10-20 04:43:36
>>redbel+(OP)
Python can be fast if you don't intentionally cripple it. Doing the following will be most likely a lot faster than postgresml:

- replace json (storing data as strings? really?) with a binary format like protobuf, or better yet parquet

- replace redis with duckdb for zero-copy reads

- replace pandas with polars for faster transformations

- use asynchronous, modern web framework for microservices like fastAPI

- Tune xgboost CPU resource usage with semaphores

◧◩
2. akx+nD[view] [source] 2022-10-20 08:18:47
>>learnd+Mk
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...
◧◩◪
3. levkk+dY1[view] [source] 2022-10-20 16:37:13
>>akx+nD
If I turn that into a single line and that improves performance 40x... I will probably not do engineering for a while after that.
◧◩◪◨
4. learnd+803[view] [source] 2022-10-20 21:38:27
>>levkk+dY1
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]