Skip to content

IDNA encoding of hostname #95

Closed
Closed
@Glandos

Description

@Glandos
  • uvloop version: 0.8.0
  • Python version: 3.5
  • Platform: Debian GNU/Linux testing
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: I don't know

Commit 1d5ae0b introduces IDNA encoding. While this is a good solution for FQDN hostnames, this is really a performance killer when sending a lot of small packets using lots of IP address (use case in boramalper/magnetico#92). On my CPU, the IDNA encoding is taking ~5% of the whole program execution, and more than 75% of the sendto method call.

The main issue here is that the sendto call is done with address given with the call to datagram_received, so uvloop should be already aware that the hostname is an IP address.
I guess that datagram_received cannot return an encoded hostname, but the idea is here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions