Closed
Description
Feature Description
This is an idea for public (feel free to take it or work on it).
Gitea's index.js
logic becomes more and more complex. On my MacBook Pro, almost every page loading says:
[Violation] 'setTimeout' handler took 99ms
[Violation] 'setTimeout' handler took 148ms
I think the setTimeout
is actually the $(document).ready(() => {})
call in index.js
, it's too complex. If that $(document).ready()
is commented out, there is no warning anymore.
So, I think in the future, it's better to avoid making the index.js
do too much slow init
calls, instead, many calls should be optimized (by various approaches)
Some clues
initHeatmap
takes around 100ms (update: vue3-calendar-heatmap 2.0.2, the time decreases from 100ms to 50ms)initGlobalCommon
is also slow, if there are many elementsinitRepoTopicBar
seems unnecessarily slow
initHeatmap() 103.100 (update: vue3-calendar-heatmap 2.0.2, the time decreases from 100ms to 50ms)
initGlobalCommon() 20.800
initDashboardRepoList() 12.400
initGlobalTooltips() 8.900
initGlobalFormDirtyLeaveConfirm() 1.400
initStopwatch() 1.100
initMarkupContent() 1.000
initRepoTopicBar() 0.600
attachTribute(document.querySelectorAll('#content, .emoji-input')) 0.400
initNotificationCount() 0.400
initMarkupAnchors() 0.300
initServiceWorker() 0.300
initRepoIssueList() 0.300
initGlobalCommon() 33.900
initRepoTopicBar() 32.300
initRepository() 10.600
initGlobalTooltips() 8.200
initGlobalFormDirtyLeaveConfirm() 1.600
initStopwatch() 0.700
initMarkupContent() 0.600
initMarkupAnchors() 0.300
attachTribute(document.querySelectorAll('#content, .emoji-input')) 0.300