Bug 551544 - EclipseStarter#updateSplash delays the startup
Summary: EclipseStarter#updateSplash delays the startup
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 4.13   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-26 18:07 EDT by Lars Vogel CLA
Modified: 2021-03-31 05:00 EDT (History)
6 users (show)

See Also:


Attachments
Trace (275.35 KB, image/png)
2019-09-26 18:07 EDT, Lars Vogel CLA
no flags Details
Screenshot (163.34 KB, image/png)
2019-09-26 18:17 EDT, Lars Vogel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2019-09-26 18:07:34 EDT
Created attachment 280056 [details]
Trace

java.util.concurrent.Semaphore.tryAcquire called by EclipseStarter#updateSplash takes a ridiculous amount of time during a warm startup, see trace.

We should try to make this faster or avoid doing it (that often).
Comment 1 Lars Vogel CLA 2019-09-26 18:17:47 EDT
Created attachment 280057 [details]
Screenshot
Comment 2 Thomas Watson CLA 2019-09-27 08:48:55 EDT
I'm curious what effect making updateSplash faster would have on startup time.  After all it is waiting for the start-level or refresh operation to complete and in the background is checking this semaphore to see if it is done and updateSplash should not continue until the operation blocking the Semaphore is done.

At any rate it seems the Semaphore could be replaced by a simple AtomicBoolean.
Comment 3 Lars Vogel CLA 2019-09-27 08:51:06 EDT
Does it have to wait for every update or can it wait for all updates in one place?
Comment 4 Thomas Watson CLA 2019-09-27 08:56:20 EDT
(In reply to Lars Vogel from comment #3)
> Does it have to wait for every update or can it wait for all updates in one
> place?

Actually thinking about this.  The reason it looks like this tryAcquire is taking so long is because it has a timeout of 50 ms.  The reason we wait for 50 ms is because that ends up being the refresh rate of the splashscreen.  I now think there is nothing to do here, it is not taking up CPU time, just mosting waiting for the operation to complete and every 50 ms doing an update of the splashscreen.
Comment 5 Eclipse Genie CLA 2019-10-01 02:46:59 EDT
New Gerrit change created: https://git.eclipse.org/r/150414
Comment 6 Eclipse Genie CLA 2019-10-01 02:47:02 EDT
New Gerrit change created: https://git.eclipse.org/r/150413
Comment 7 Lars Vogel CLA 2021-03-31 05:00:40 EDT
In an RCP application I have an immediate component. 

----
@Component(immediate = true)
public class WFCTranslationDownloadService {

	public WFCTranslationDownloadService() {
		System.out.println("Download zip file");

	}

}
----

During startup the main thread blocks in #updateSplash in 				if (semaphore.tryAcquire(50, TimeUnit.MILLISECONDS)). Is this expected?