Closed yozachar closed 5 months ago
Opening a file and scanning it for every email validation is very inefficient.
That's true for repeated validations.
Is the memory footprint that much of a concern?
Yes, if the file is too, large and/or, system memory is insufficient.
What about a load_iana_tld()
method?
It will load and store the TLDs once. If that method isn't called, it'll lookup the file every time. Associate that method with a dataclass
, instead of using global variables.
A PR is welcome.
This significantly slows down TLD lookup. Opening a file and scanning it for every email validation is very inefficient. Is the memory footprint that much of a concern?
Would you be open to changing it back to something like this, which is 10 times faster?