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

Use escape_utils if available, fall-back on CGI. #10

Merged
merged 1 commit into from Aug 13, 2013
Merged

Use escape_utils if available, fall-back on CGI. #10

merged 1 commit into from Aug 13, 2013

Conversation

wpeterson
Copy link
Owner

  • Try to load escape_utils and gracefully handle missing requirement
  • Fall back on CGI.escape_html implementation
  • Update README to explain how to use escape_utils

Benchmarks showing 10x-100x improvement.

@wpeterson
Copy link
Owner Author

I updated http://polarb.com/ to use the latest emoji gem without escape_utils and we saw a real performance hit. In a number of places we have 3 fields on a model we want web emoji support for and up to 10 models being rendered (30 emoji replacement calls in a given request).

I ended up doing a number of benchmarks and using escape_utils to replace HTML escaping for our entire Rails app, which cut our view rendering times about in half. So, this does seem to matter.

steveklabnik added a commit that referenced this pull request Aug 13, 2013
Use escape_utils if available, fall-back on CGI.
@steveklabnik steveklabnik merged commit b81398c into wpeterson:master Aug 13, 2013
@steveklabnik
Copy link
Collaborator

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants