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

Optimize uri normalization #4212

Merged
merged 2 commits into from Jul 15, 2017

Conversation

Projects
None yet
3 participants
@ThibG
Copy link
Collaborator

commented Jul 15, 2017

Minor optimizations out of my previous “fix-push” PR request (now obsolete) that heavily used URI normalization.
While it provided a ×5 speed-up in that situation, there should be no single task in Mastodon making such heavy use of URI normalization, so the benefits are not that obvious.
Nevertheless, URI normalization happens frequently in Mastodon, so this should contribute to reducing Mastodon's CPU usage overall.

ThibG added some commits May 6, 2017

Use normalized_host instead of normalize.host when applicable
When we are only interested in the normalized host, calling normalized_host
avoids normalizing the other components of the URI as well as creating a
new object

@ThibG ThibG added the performance label Jul 15, 2017

@Gargron Gargron merged commit 05cd370 into tootsuite:master Jul 15, 2017

2 checks passed

codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Gargron

This comment has been minimized.

Copy link
Member

commented Jul 15, 2017

Note: I had to install libidn11-dev on my Ubuntu 16.04 to get ruby-idn to install.

@beatrix-bitrot

This comment has been minimized.

Copy link
Contributor

commented Jul 15, 2017

@ykzts ykzts referenced this pull request Jul 16, 2017

Merged

Install libidn with Docker #4219

masarakki added a commit to masarakki/mastodon that referenced this pull request Jul 19, 2017

Optimize uri normalization (tootsuite#4212)
* Add dependency on idn-ruby to speed up URI normalization

* Use normalized_host instead of normalize.host when applicable

When we are only interested in the normalized host, calling normalized_host
avoids normalizing the other components of the URI as well as creating a
new object

@ykzts ykzts referenced this pull request Aug 2, 2017

Closed

Lots of IDN::Idna::IdnaError in puma log #4496

2 of 2 tasks complete

YaQ00 added a commit to YaQ00/mastodon that referenced this pull request Sep 5, 2017

Optimize uri normalization (tootsuite#4212)
* Add dependency on idn-ruby to speed up URI normalization

* Use normalized_host instead of normalize.host when applicable

When we are only interested in the normalized host, calling normalized_host
avoids normalizing the other components of the URI as well as creating a
new object

@ThibG ThibG deleted the ThibG:optimize-uri-normalization branch Oct 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.