Framework7: Running a F7 project has high CPU load

Created on 19 Jan 2019  路  14Comments  路  Source: framework7io/framework7

  • Framework7 version: 4.0.0 beta 25
  • Platform and Target: Mac, iOs, Android (not tested on Windows)

When running devServer and opening any project in a browser (e.g. kitchen-sink at http://0.0.0.0:3000/kitchen-sink/vue/, the CPU-load jumps to 99% (quad-core i7 iMac)
image

It seems to constantly invalidate and re-render all styles.

This makes it impossible to preview a project on slower devices, because rendering impacts the whole performance of such a device. (If you want to check: Get an older Android device and run 'Cards expandable' on it -> It flickers like crazy)

Btw: you can reproduce it on Safari for Mac or Android WebView.
On Chrome and Firefox it works

wontfix

Most helpful comment

Yes, so if we replace it here with actual value then issue with overload is gone

All 14 comments

See this issue on desktop Safari, could be Safari issue on how it handles CSS vars. Will investigate

Ok, found out it is a WebKit bug https://bugs.webkit.org/show_bug.cgi?id=194332

Cool! Great find!! I'll see, if I can disable the gradients and test again!

Temporary solution, just add this CSS rule to custom stylesheet:

.md .navbar a.link:before,
.md .toolbar a.link:before,
.md .subnavbar a.link:before,
.md .data-table-rows-select a.link:before,
.md .data-table-pagination a.link:before,
.md .searchbar-disable-button:before,
.md .searchbar .input-clear-button:before,
.md .notification-close-button:before {
  background-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.1) 66%, rgba(255, 255, 255, 0) 66%);
}

Ah - so you mean it's really just affected, when custom properties inside gradients are used??

Yes, so if we replace it here with actual value then issue with overload is gone

I also noticed, high cpu usage on desktop (OSX 10.14.3, Safari, Fr7 4.1.1), default theme: 'md'. When I switch to 'ios' theme it works fine. On Chrome and FF no issue at all with both themes 'md' or 'ios'. I tried css fix for 'md' theme but no luck.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically closed due to inactivity. If this issue is still actual, please, create the new one.

This is still a problem in Safari 13.0.3 with md theme. I added the suggested CSS rule and that solved it for me. Thanx!

Temporary solution, just add this CSS rule to custom stylesheet:

.md .navbar a.link:before,
.md .toolbar a.link:before,
.md .subnavbar a.link:before,
.md .data-table-rows-select a.link:before,
.md .data-table-pagination a.link:before,
.md .searchbar-disable-button:before,
.md .searchbar .input-clear-button:before,
.md .notification-close-button:before {
  background-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.1) 66%, rgba(255, 255, 255, 0) 66%);
}

on a 2.6 GHz 6-Core Intel Core i7 processor, running on MBP 16" 2019, MacOS Catalina:

  • without this CPU usage is roughly 10%
  • with this CPU usage is less than 2%

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically closed due to inactivity. If this issue is still actual, please, create the new one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ahmeddaif1 picture ahmeddaif1  路  4Comments

vousys picture vousys  路  4Comments

cloudus picture cloudus  路  5Comments

iBinJubair picture iBinJubair  路  4Comments

J05HI picture J05HI  路  3Comments