HackerTrans
TopNewTrendsCommentsPastAskShowJobs

alsadi

no profile record

Submissions

Have you considered defusing SSH from the likes of xz backdoors?

bcksp.blogspot.com
1 points·by alsadi·2 वर्ष पहले·0 comments

I identified another bottleneck in WASM Python binding

old.reddit.com
2 points·by alsadi·3 वर्ष पहले·0 comments

Show HN: I made calling WebAssembly from Python 25x times Faster

medium.com
5 points·by alsadi·3 वर्ष पहले·0 comments

Why there are randomness in ranking algorithm?

medium.com
2 points·by alsadi·3 वर्ष पहले·0 comments

Serving Files in Python: How FastAPI Failed Us

medium.com
5 points·by alsadi·3 वर्ष पहले·10 comments

comments

alsadi
·2 वर्ष पहले·discuss
Untill the entire scope of this is identified I suggest activating the kill switch

https://bcksp.blogspot.com/2024/03/how-to-disable-xz-backdoo...
alsadi
·3 वर्ष पहले·discuss
here I've eliminated uvicorn, nothing changed

https://gist.github.com/muayyad-alsadi/3a1e1cdbafca34df8b178...
alsadi
·3 वर्ष पहले·discuss
Many things have changed since the old days. In PEP 3333 sendfile is exposed as opposed to PEP 333 (so in the WSGI days they had no way of doing it, but in ASGI they can do it).

The assumption that nginx is always there no longer hold, specially in microservices, ex. Running behind haproxy (does not service static files) or running bechind cloud provides like AWS ALB.
alsadi
·3 वर्ष पहले·discuss
As I pointed out in my other comment, serving a static file should be a single call to a kernel routine called sendfile (sendfile in c or in python io.sendfile or loop.sendfile). No loop, no memory copy, no further context switch.

Again if you think I was not fair to fastapi, suggest a change to the fastapi part. Do not cripple the competing solution.

If you want believe the time is wasted by the introduction of uvicorn layer as opposed to pure python implementation, I can run the fastapi in pure python ASGI without that layer, it would be worse. Because you uvicorn is one of the best implements.
alsadi
·3 वर्ष पहले·discuss
BTW being ASGI is not excuse because ASGI spec (PEP 3333) have a section on how to expose and make use of sendfile kernel routine.

https://peps.python.org/pep-3333/#optional-platform-specific...
alsadi
·3 वर्ष पहले·discuss
I made it like that to be as fair as possible and as simple as possible. I've done other experiments with same results. If you think I was not fair to the fastapi part feel free to edit the fastapi part in the form of github gist. And give me the link.
alsadi
·3 वर्ष पहले·discuss
It's reported here and they suggest adding nginx with x-accel which is basically surrending.

https://github.com/tiangolo/fastapi/issues/5803
alsadi
·5 वर्ष पहले·discuss
Computers are just infinite tape marked out into squares... (Turing machine). A pyramid is just a stack of cubic rocks.
alsadi
·5 वर्ष पहले·discuss
I do agree. When I first see it I knew that. Comparing two sequences (actual dom and dom) to find diff is like O(n^2) and the assumption that dom ops is expensive is a lie (premature optimization). Dom ops on ids and classes and fragments is very fast. In most cases a slow dom is always a developer fault failing to use fragments.