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

CLDR-17461 Forum posts in vetting view, boost performance, change icons #3694

Merged
merged 1 commit into from
May 7, 2024

Conversation

btangmu
Copy link
Member

@btangmu btangmu commented May 7, 2024

-Add a cache localeForumStatusMap in SurveyForum.java

-New class SurveyForum.LocaleForumStatus

-Get all the status for a locale with a single sql call

-Clear the cache for a locale when a post is added/closed

-Revise icons in the Comparison (English) column: 👁️‍🗨️ and 💬

-👁️‍🗨️ means: This item has one or more forum posts, some of which are open

-💬 means: This item has one or more forum posts, all of which are closed

-Change let to const for two items in cldrSurvey.mjs; remove @Property

-Call updateRowEnglishComparisonCell even if isSetup, and always removeAllChildNodes; old optimization assumed the cell contents never changed

CLDR-17461

  • This PR completes the ticket.

ALLOW_MANY_COMMITS=true

@btangmu btangmu self-assigned this May 7, 2024
@btangmu
Copy link
Member Author

btangmu commented May 7, 2024

Running this locally with JProfiler, there's no longer a major hot spot for the sql query. PathForumStatus is 0.0% at the bottom of this screenshot:

image

@btangmu
Copy link
Member Author

btangmu commented May 7, 2024

It turns out that making/closing a forum post DOES update json.localeStamp, but the main table cell wasn't getting updated due to an old optimization based on an assumption that the Comparison (English) column never changes!

In cldrTable.mjs:

  /*
   * Set up the "comparison cell", a.k.a. the "English" column.
   */
  if (comparisonCell && !comparisonCell.isSetup) {
    updateRowEnglishComparisonCell(tr, theRow, comparisonCell);
  }

If I remove && !comparisonCell.isSetup then the cell updates, but in a funny way, new data adding to old data instead of replacing it:

image

That can be fixed by adding this line with removeAllChildNodes:

function updateRowEnglishComparisonCell(tr, theRow, cell) {
  cldrDom.removeAllChildNodes(cell);

I'll follow up...

Copy link
Member

@srl295 srl295 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great to me!

@btangmu
Copy link
Member Author

btangmu commented May 7, 2024

My second commit fixed the comparisonCell problem; I'll squash...

-Add a cache localeForumStatusMap in SurveyForum.java

-New class SurveyForum.LocaleForumStatus

-Get all the status for a locale with a single sql call

-Clear the cache for a locale when a post is added/closed

-Revise icons in the Comparison (English) column: 👁️‍🗨️ and 💬

-👁️‍🗨️ means: This item has one or more forum posts, some of which are open

-💬 means: This item has one or more forum posts, all of which are closed

-Change let to const for two items in cldrSurvey.mjs; remove @Property

-Call updateRowEnglishComparisonCell even if isSetup, and always removeAllChildNodes; old optimization assumed the cell contents never changed
@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

@srl295
Copy link
Member

srl295 commented May 7, 2024

My second commit fixed the comparisonCell problem; I'll squash...

squash is usually not needed, because we squash on merge anyway. It actually makes it harder to see what the additional change was separately.

@btangmu
Copy link
Member Author

btangmu commented May 7, 2024

@srl295 "we squash on merge anyway" -- was that always true? anyway, good to know, I agree the changes in a PR are often easier to see without the squashing

@btangmu btangmu merged commit 280cead into unicode-org:main May 7, 2024
11 checks passed
@btangmu btangmu deleted the t17461_d branch May 7, 2024 18:09
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.

3 participants