eclipse.platform.swt icon indicating copy to clipboard operation
eclipse.platform.swt copied to clipboard

new Composite().dispose() is slow on Mac OS

Open basilevs opened this issue 1 year ago • 9 comments
trafficstars

Creation and disposal of a Composite on Mac OS are very slow

To Reproduce Run https://github.com/eclipse-platform/eclipse.platform.swt/blob/02c8a22116599a507db2dd424dd20cc778db64d4/tests/org.eclipse.swt.tests/JUnit%20Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java#L72-L105

It takes 28 minutes to execute on Mac OS

Expected behavior

The test should complete in seconds, like on Linux and Windows.

Screenshots

Screenshot 2023-11-27 at 23 50 25

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • [ ] All OS
    • [ ] Windows
    • [ ] Linux
    • [x] macOS
  1. Additional OS info (e.g. OS version, Linux Desktop, etc) Reproducible in CI Reproducible on MacOS Monterey

  2. JRE/JDK version 17

Version since The test performance meter was implemented incorrectly - it failed to measure deferred events. Performance tests were never run on CI and performance assertions were disabled three years ago. https://github.com/eclipse-platform/eclipse.platform.releng/commit/071af511debfd17e1c12a66e7d79d93e943ae2cd#diff-55cfefb6d6ca7ae136d8057fc7ea93d8b62af5db44fc77cec0f961fc68d2bdbdL85 So the exact date of regression is unclear.

Workaround (or) Additional context Don't create composites on MacOS.

basilevs avatar Nov 27 '23 19:11 basilevs

History of performance tests by @akurtakov : https://github.com/eclipse-platform/eclipse.platform.swt/pull/906#issuecomment-1828505166

basilevs avatar Nov 27 '23 20:11 basilevs

For the record - Perf tests results (at least as far as I'm aware) have only be produced by the project on Linux. I was never involved nor remember anything about anyone using these perf tests on Win/Mac in the open.

akurtakov avatar Nov 27 '23 20:11 akurtakov

I'd like to prevent regressions like this from happening again. The first step that comes to mind - instead of tracking perf data externally, add a sensible assertion in the test code.

However, I'm not sure what is sensible. Is 250 ms per Composite normal on MacOS?

basilevs avatar Nov 27 '23 20:11 basilevs

Unfortunately, I have found any timing in VMs to be totally unreliable. Sometimes VMs just "sleep" for extended periods and next time they "wakeup" the wallclock is already above any threshold even though the VM was not active and thus did nothing.

akurtakov avatar Nov 27 '23 20:11 akurtakov

Exact, we see same in our internal tests in VM's. Any time/performance results totally unreliable

iloveeclipse avatar Nov 27 '23 20:11 iloveeclipse

Here, the test takes 28 minutes, how unreliable should VM be to skip half an hour?

basilevs avatar Nov 27 '23 20:11 basilevs

Depends on how host is configured and how many other instances use same hardware.I saw pauses of ~15 minutes , where the VM itself was not doing anything.

iloveeclipse avatar Nov 27 '23 20:11 iloveeclipse

Here, the test takes 28 minutes, how unreliable should VM be to skip half an hour?

If it's github runner - it might have been affected by the degraded GHA right now https://www.githubstatus.com/

akurtakov avatar Nov 27 '23 20:11 akurtakov

The test was done on physical Mac Book Pro produced in 2021 and still took 28 minutes. VM slowdowns do not justify/explain the performance.

basilevs avatar Feb 05 '24 05:02 basilevs