| Summary: | [Cocoa] Link and multi-line Text hog CPU in dark theme | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Alexandr Miloslavskiy <alexandr.miloslavskiy> | ||||
| Component: | SWT | Assignee: | Alexandr Miloslavskiy <alexandr.miloslavskiy> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | alexandr.miloslavskiy, lshanmug, marc.strapetz, p.beauvoir, ts-swt | ||||
| Version: | 4.19 | ||||||
| Target Milestone: | 4.19 M1 | ||||||
| Hardware: | Macintosh | ||||||
| OS: | Mac OS X | ||||||
| See Also: |
https://bugs.eclipse.org/bugs/show_bug.cgi?id=540357 https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/173520 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=86f4c9a08a2c885d029db8f1d01af4248172495c |
||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Alexandr Miloslavskiy
Created attachment 284985 [details]
Reproducing snippet
Bug is also present at least on macOS 10.15. The difference is that on BigSur, even invisible links will hog CPU. To my understanding, the problem is caused by Bug 540357. I have tried replacing Bug 540357 with 'setUsesAdaptiveColorMappingForDarkAppearance:'. Unfortunately, it also remaps colors set with 'Link.setBackground()' etc, thus causing these SWT API to have unexpected effect. I tested the snippet on Big Sur 11.0.1 with MacBook Air 2020 and dark theme. I see around 55% continual CPU usage. Running the snippet with Light theme the CPU usage is negligible. New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/173520 I consider the bug to be bad enough, because SWT applications will constantly slow down the computer and drain battery life. On BigSur, this even happens when the app is minimized! I also noticed another bug, using snippet submitted with patch: 1) Click button 'Set/remove colors' for Links 2) Click button 'Enable/disable' for Links 3) Link texts are barely visible. This is unchanged by my patch. Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/173520 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=86f4c9a08a2c885d029db8f1d01af4248172495c Thanks for the fix, Alexandr! Thanks for reviewing! Verified with I20210104-1800 |