Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[optimization] change urlparse to urlsplit #1581

Closed
karlcow opened this issue Jun 5, 2017 · 3 comments
Closed

[optimization] change urlparse to urlsplit #1581

karlcow opened this issue Jun 5, 2017 · 3 comments

Comments

@karlcow
Copy link
Member

karlcow commented Jun 5, 2017

In form.py , there is the function domain_name which extracts the domain name. It uses urlparse.urlparse() which is less performant than urlparse.urlsplit().

def domain_name(url):
    '''Extract the domain name of a sanitized version of the submitted URL.'''
    # Removing leading spaces
    url = url.lstrip()
    # testing if it's an http URL
    if url.startswith(SCHEMES):
        domain = urlparse.urlparse(url).netloc
    else:
        domain = None
    return domain
@zoepage
Copy link
Member

zoepage commented Jun 6, 2017

Removing the label scope: refactor as this one is mainly for the front end refactor purpose.

@rheaparekh
Copy link
Contributor

Can I make the changes if this is not yet worked upon?

@karlcow
Copy link
Member Author

karlcow commented Aug 17, 2017

rheaparekh added a commit to rheaparekh/webcompat.com that referenced this issue Aug 18, 2017
karlcow added a commit that referenced this issue Aug 18, 2017
Fixes #1581- [optimization] change urlparse to urlsplit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants