René's URL Explorer Experiment


Title: feat: cache IANA TLDs for faster lookups by salty-horse · Pull Request #390 · python-validators/validators · GitHub

Open Graph Title: feat: cache IANA TLDs for faster lookups by salty-horse · Pull Request #390 · python-validators/validators

X Title: feat: cache IANA TLDs for faster lookups by salty-horse · Pull Request #390 · python-validators/validators

Description: Follow-up to the discussion in #362. I wasn't sure what was meant by using dataclass, as this isn't a data-first class. I used a regular class, instead. One thing that's obviously missing is tests. I'm not familiar with pytest, and don't know how to re-run the existing domain tests after running the new "load" function. Here are some basic timing results: $ python -m timeit -s 'import validators' 'validators.domain("example.com", consider_tld=True)' 5000 loops, best of 5: 63.5 usec per loop $ python -m timeit -s 'import validators; validators.load_iana_tlds_to_memory()' 'validators.domain("example.com", consider_tld=True)' 50000 loops, best of 5: 4.63 usec per loop $ python -m timeit -s 'import validators' 'validators.domain("example.blabla", consider_tld=True)' 1000 loops, best of 5: 200 usec per loop $ python -m timeit -s 'import validators; validators.load_iana_tlds_to_memory()' 'validators.domain("example.blabla", consider_tld=True)' 20000 loops, best of 5: 16.5 usec per loop

Open Graph Description: Follow-up to the discussion in #362. I wasn't sure what was meant by using dataclass, as this isn't a data-first class. I used a regular class, instead. One thing that's obviously missi...

X Description: Follow-up to the discussion in #362. I wasn't sure what was meant by using dataclass, as this isn't a data-first class. I used a regular class, instead. One thing that's obv...

Opengraph URL: https://github.com/python-validators/validators/pull/390

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/checks(.:format)
route-controllerpull_requests
route-actionchecks
fetch-noncev2:a63ebb7d-eee2-2931-e084-049cad06df74
current-catalog-service-hash87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a
request-idAF90:130B0:9697CA:C3CF74:698EB692
html-safe-nonce813e9ba26014c556f751eb37e9f7951035eccb4f2fdd4e10e37d8e0bd5dba9b2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjkwOjEzMEIwOjk2OTdDQTpDM0NGNzQ6Njk4RUI2OTIiLCJ2aXNpdG9yX2lkIjoiMzkyMzg1MTMxNTU5NjE0NjMyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacae5344af97eeda6e55c746e1f293fb585841bdd250bb2267cd6b3cf9e9145ce1
hovercard-subject-tagpull_request:1971272916
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/checks
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python-validators/validators/pull/390/checks
twitter:imagehttps://avatars.githubusercontent.com/u/28355?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/28355?s=400&v=4
og:image:altFollow-up to the discussion in #362. I wasn't sure what was meant by using dataclass, as this isn't a data-first class. I used a regular class, instead. One thing that's obviously missi...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecb2828a801ee6b7be618f3ac76fbf55def35bbc30f053a9c41bf90210b8b72ba
turbo-cache-controlno-preview
go-importgithub.com/python-validators/validators git https://github.com/python-validators/validators.git
octolytics-dimension-user_id113113270
octolytics-dimension-user_loginpython-validators
octolytics-dimension-repository_id13642984
octolytics-dimension-repository_nwopython-validators/validators
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id13642984
octolytics-dimension-repository_network_root_nwopython-validators/validators
turbo-body-classeslogged-out env-production page-responsive full-width full-width-p-0
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee6b91a7e6e46287d26887e3fb7a4161657bab8f7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-validators/validators/pull/390/checks#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-validators%2Fvalidators%2Fpull%2F390%2Fchecks
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-validators%2Fvalidators%2Fpull%2F390%2Fchecks
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Fchecks&source=header-repo&source_repo=python-validators%2Fvalidators
Reloadhttps://github.com/python-validators/validators/pull/390/checks
Reloadhttps://github.com/python-validators/validators/pull/390/checks
Reloadhttps://github.com/python-validators/validators/pull/390/checks
python-validators https://github.com/python-validators
validatorshttps://github.com/python-validators/validators
Notifications https://github.com/login?return_to=%2Fpython-validators%2Fvalidators
Fork 169 https://github.com/login?return_to=%2Fpython-validators%2Fvalidators
Star 1.1k https://github.com/login?return_to=%2Fpython-validators%2Fvalidators
Code https://github.com/python-validators/validators
Issues 4 https://github.com/python-validators/validators/issues
Pull requests 3 https://github.com/python-validators/validators/pulls
Discussions https://github.com/python-validators/validators/discussions
Actions https://github.com/python-validators/validators/actions
Projects 0 https://github.com/python-validators/validators/projects
Wiki https://github.com/python-validators/validators/wiki
Security 0 https://github.com/python-validators/validators/security
Insights https://github.com/python-validators/validators/pulse
Code https://github.com/python-validators/validators
Issues https://github.com/python-validators/validators/issues
Pull requests https://github.com/python-validators/validators/pulls
Discussions https://github.com/python-validators/validators/discussions
Actions https://github.com/python-validators/validators/actions
Projects https://github.com/python-validators/validators/projects
Wiki https://github.com/python-validators/validators/wiki
Security https://github.com/python-validators/validators/security
Insights https://github.com/python-validators/validators/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython-validators%2Fvalidators%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython-validators%2Fvalidators%2Fissues%2Fnew%2Fchoose
nandgatorhttps://github.com/nandgator
python-validators:masterhttps://github.com/python-validators/validators/tree/master
salty-horse:load_iana_tlds_to_memoryhttps://github.com/salty-horse/validators/tree/load_iana_tlds_to_memory
Conversation 25 https://github.com/python-validators/validators/pull/390
Commits 5 https://github.com/python-validators/validators/pull/390/commits
Checks 0 https://github.com/python-validators/validators/pull/390/checks
Files changed 1 https://github.com/python-validators/validators/pull/390/files
Please reload this pagehttps://github.com/python-validators/validators/pull/390/checks
feat: cache IANA TLDs for faster lookups https://github.com/python-validators/validators/pull/390/checks#top
Please reload this pagehttps://github.com/python-validators/validators/pull/390/checks
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.