About page slow / Menu slow to disapear

When selecting About from the hamburger :hamburger: menu the menu appears to be dismissed very slowly.

This is kinda two bugs / issues:

  1. Menu should be dismissed immediately upon click (from a user experience / feedback point of view).
  2. The about page is slow to load

####Although the issue doesnโ€™t look that bad on meta:

####But when you compare that to a site with a larger number of posts:

####Possible slow query

1๊ฐœ์˜ ์ข‹์•„์š”

Iโ€™m willing to bet thereโ€™s no โ€œpossibleโ€ about it.

Iโ€™m wondering if โ€œreal time - liveโ€ stats are needed here.

Would it be that big of a deal if โ€œall timeโ€ and โ€œ7 daysโ€ were a bit off depending on the time the About page was looked at?

Personally, I donโ€™t have a problem with the page load time, but maybe some kind of CRON could be used to get the stats โ€œclose enoughโ€?

At least for the About. IMHO the Admin stats are viewed less frequently and by those more understanding so leaving them to be created โ€œwhen calledโ€ should be OK as is and have benefit the way they are.

The load time isnโ€™t that much of an issue - itโ€™s the menu not dismissing that made me want to report itโ€ฆ
โ€ฆ it makes it โ€œfeel brokenโ€.

True, it is nice to get visual confirmation that a click worked.

I would think it would be easy enough to remove the highlighting upon the click event, but maybe not.

@neil for this page, drop the deleted_at part of the query โ€“ the total posts minus deletions is just going to be noise, how many can there possibly be? We donโ€™t need that much accuracy here.

I am guessing

select count(*) from "posts"

will run plenty fast.

1๊ฐœ์˜ ์ข‹์•„์š”

Could this be an indicator of other slowness?

Perhaps select is used elsewhere in combination with deleted_at = null.

I have reported many slow queries in the past that havenโ€™t seen any developer action.

Iโ€™m just throwing it out there.

Possibly but rarely select *

Seems like there should be some logic to dismiss the dropdown on click instead of waiting for the page to load.

Actually, yeah, this is an indicator of a missing index.

The posts table has no index on deleted_at, and almost all queries against the table filter for that!

1๊ฐœ์˜ ์ข‹์•„์š”

The index only improves it a bit, it still has to scan the entire index to get the count, data here should be cached at least for a few minutes, and the transition should be smoother.

3๊ฐœ์˜ ์ข‹์•„์š”

Iโ€™m working on a fix right now for the dropdown not dismissing until the new page loads. Iโ€™ve provided two samples below, fadeOut('fast') and hide() respectively.

fadeOut('fast')

hide()

Would love to get some thoughts on which to go with. :smile:

fade out fast seems fine to me.

1๊ฐœ์˜ ์ข‹์•„์š”

Just submitted a fix to dismiss dropdowns on click. Will look into about page issue soon.

https://github.com/discourse/discourse/pull/3571

2๊ฐœ์˜ ์ข‹์•„์š”

Could I get a rough count of how many posts was on the site? Iโ€™m trying to reproduce the performance issue on development. Thanks :smile:

Topics: 40.1K
Posts: 432.2K
Users: 10.2K
Private Message Topics: 101.0K

1๊ฐœ์˜ ์ข‹์•„์š”

Patch landed on master. :smile:
https://github.com/discourse/discourse/commit/b0ea6764e0f1282e262182a3e1f048bd4b59d34f

Both issue in this topic should be resolved.

2๊ฐœ์˜ ์ข‹์•„์š”

As fast as lightning ! thanks heaps :heart:

1๊ฐœ์˜ ์ข‹์•„์š”