Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Extracted code to expand an URI toUriExpander#35415

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromlyrixx:url-expander
Feb 4, 2020

Conversation

lyrixx
Copy link
Member

QA
Branch?master
Bug fix?no
New feature?yes
Deprecations?no
Tickets
LicenseMIT
Doc PR

When building a crawler we need to extract and to expand all links on a
web pages.

ATM, we need to create a DomDocument, attach the href, and ask for the
full URL.

This is a bit slow, and unecessary. This is why I extracted the minimal
code to expand the URL to its onw trait for better re-usability.

I benched (a specific part of) my application:

  • before: 2.16ms
  • after: 1.42ms

@lyrixx
Copy link
MemberAuthor

@nicolas-grekas thanks for the review. I addressed your comments

@fabpot
Copy link
Member

@lyrixx Can you fix the code :)

lyrixx reacted with thumbs up emoji

@lyrixxlyrixx changed the titleExtracted code to expand an URI toUriExpanderTraitExtracted code to expand an URI toUriExpanderFeb 4, 2020
@fabpot
Copy link
Member

Thank you@lyrixx.

fabpot added a commit that referenced this pull requestFeb 4, 2020
This PR was merged into the 5.1-dev branch.Discussion----------Extracted code to expand an URI to `UriExpander`| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| Deprecations? | no| Tickets       || License       | MIT| Doc PR        |When building a crawler we need to extract and to expand all links on aweb pages.ATM, we need to create a DomDocument, attach the href, and ask for thefull URL.This is a bit slow, and unecessary. This is why I extracted the minimalcode to expand the URL to its onw trait for better re-usability.I benched (a specific part of) my application: * before: 2.16ms * after: 1.42msCommits-------0c499c6 Extracted code to expand an URI to `UriExpanderTrait`
@fabpotfabpot merged commit0c499c6 intosymfony:masterFeb 4, 2020
@lyrixxlyrixx deleted the url-expander branchFebruary 4, 2020 13:05
@nicolas-grekasnicolas-grekas modified the milestones:next,5.1May 4, 2020
@fabpotfabpot mentioned this pull requestMay 5, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@OskarStarkOskarStarkOskarStark left review comments

@ro0NLro0NLro0NL left review comments

@fabpotfabpotfabpot approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
5.1
Development

Successfully merging this pull request may close these issues.

6 participants
@lyrixx@fabpot@nicolas-grekas@OskarStark@ro0NL@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp