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

Speed up HTML encoder for 1.2#153

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

Open
korny wants to merge19 commits intomaster
base:master
Choose a base branch
Loading
frompossible-speedups
Open

Conversation

@korny
Copy link
Member

  • create less objects during setup
  • cache most recent 100 escaped strings
  • don't extend output unless necessary
  • lazy CSS loading and parsing

Quick benchmarking yields a ~10% speedup for Ruby code:

2.3.0@coderay ~/ruby/coderay:master rake bench/Users/murphy/.rvm/rubies/ruby-2.3.0/bin/ruby bench/bench.rb ruby html 3000encoding 3000 kB of ruby code to html...run 1:  1.69 s, 1774 kB/srun 2:  1.67 s, 1794 kB/srun 3:  1.68 s, 1786 kB/srun 4:  1.66 s, 1805 kB/srun 5:  1.69 s, 1775 kB/s2.3.0@coderay ~/ruby/coderay:possible-speedups rake bench/Users/murphy/.rvm/rubies/ruby-2.3.0/bin/ruby bench/bench.rb ruby html 3000encoding 3000 kB of ruby code to html...run 1:  1.49 s, 2010 kB/srun 2:  1.49 s, 2011 kB/srun 3:  1.49 s, 2014 kB/srun 4:  1.50 s, 1994 kB/srun 5:  1.49 s, 2017 kB/s

@ghostghost assignedkornyAug 31, 2013
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

@kornykorny

Projects

None yet

Milestone

1.2

Development

Successfully merging this pull request may close these issues.

2 participants

@korny

[8]ページ先頭

©2009-2025 Movatter.jp