Technical details for the recent optimization ( a) ERB templates are amazingly slow, and there is no hard way of improving this, because Erubis seems to be the fastest implementation. However, there is an easy way: use standard template caching (, as we have a really good mechanism for cache coherence (we can also use Russian-doll caching, the same as everywhere else.
b) several simple shotgun queries (aka N + 1 queries) were removed. Also, several places where we made an SQL query with empty list of things to search for are now skipped. ‎- псы в рапиде
c) was used for profiling (both flamegraph mode and the SQL queries window). ‎- псы в рапиде
d) we have two drastically different patterns: cold cache and warm/hot cache. ERB improvements are visible mostly for the warm cache, of course. Cold cache situation is totally different: it again has basically a lot of shotgun queries, which are really hard to optimize because each post is processed separately for the sake of code simplicity. So, cold cache page executes more than 600 SQL queries typically (this usually takes more than 1.5 seconds). After reload the same page executes around 20 very simple SQL queries, with the load time dropping to less than 150 ms. ‎- псы в рапиде
e) page prefetch is currently horribly broken, but I hope to fix it next week, and this will again improve perceived performance for some cases. ‎- псы в рапиде