Skip to content

add trsock module for greater speeds#6

Open
Vizonex wants to merge 2 commits intotarasko:masterfrom
Vizonex:trsock
Open

add trsock module for greater speeds#6
Vizonex wants to merge 2 commits intotarasko:masterfrom
Vizonex:trsock

Conversation

@Vizonex
Copy link
Copy Markdown

@Vizonex Vizonex commented Mar 23, 2026

Decided to screw around with something and In doing so I found an upgrade. I have a exposable Socket CAPI that I found when writing pywepoll and I decided to add that here to see if performance would improve in some areas.

@tarasko
Copy link
Copy Markdown
Owner

tarasko commented Mar 23, 2026

Hi @Vizonex, it's good to see you here :)

I totally agree it is nice to remove the dependency on asyncio.trsock and have our own copy of TransportSocket.
But for now I would prefer to exclude socket.pxd from this PR.

The thing is, without a clear use-case and benchmark results, these extra 150 lines in socket.pxd is just an additional burden for the project.

The project is already using send/writev/WSASend directly without python layer in transport.pyx.
As for the rest socket methods (getpeername, getsockname, etc), if they ever become a bottleneck their results can always be cached by user from Protocol.connection_made.

Honestly, I'm not sure if TransportSocket should be even cythonized. The code there is rarely used, out of the hot path. Less compilation time, simplified debugging is always good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants