discourse/app/views
Sam 7c5a448f63 PERF: remove 10-20ms of work from every page view
<%  s=Time.now;

main_app.categories_path
main_app.guidelines_path
main_app.tos_path
main_app.privacy_path

p (Time.now-s)*1000%>

Returns 10-20ms consistently on i7-4770k, on shared hosts the cost
could easily reach 40ms

This code simply calculates the strings

/categories
/guidelines
/tos
/privacy

It is ludicrous to spend this enormous amount of work just to calculate
4 strings.

I do not know if this is something specific about Discourse or a bug in
Rails (I tried without the main_app prefix and got similar results),
regardless we can got to avoid these _path APIs for now

Discovered this when running a flamegraph on our home page.
2016-01-21 22:43:56 +11:00
..
application UX: fix container layout 2015-07-28 13:58:30 +05:30
categories FIX: Bad page title for categories view by google crawler 2015-06-08 12:07:35 -04:00
common UX: Upgrade Font Awesome to 4.5.0 2015-12-10 17:19:23 -05:00
default Initial release of Discourse 2013-02-05 14:16:51 -05:00
email Unsubscribe via email 2016-01-20 22:25:25 +13:00
embed FIX: Incorrect subfolder authors urls when embedding 2016-01-13 12:24:03 +03:00
exceptions FEATURE: add clean support for running Discourse in a subfolder 2015-03-09 13:14:29 +11:00
invites FEATURE: add site setting allow_new_registrations which can be used to block all new account registrations 2014-07-14 15:42:22 -04:00
layouts PERF: remove 10-20ms of work from every page view 2016-01-21 22:43:56 +11:00
list FIX: do not include word 'Topics' in title of category pages for Googlebot 2015-11-12 12:36:32 +05:30
pending_flags_mailer UX: show flag counts in new line 2015-07-27 19:54:17 +05:30
posts Don't error on posts#latest if a post does not have a topic 2015-10-16 14:44:48 +03:00
robots_txt better disallow search ... this could get ugly 2015-04-02 17:08:00 +11:00
search UX: move search to its own route 2015-07-27 16:47:06 +10:00
static FEATURE: add email query param to login, signup, and password-reset URLs to prefill form 2016-01-19 16:53:46 -05:00
topics FEATURE: better unfurling of Discourse topics on Slack 2015-12-28 19:10:19 +05:30
user_notifications FIX: unescape emojis in digests 2015-10-15 09:59:29 +02:00
users FIX: only invalidate password reset links using javascript 2016-01-04 11:48:54 -05:00