The author has an eclipse-optimized chapter in the book on "Deep understanding of Java Virtual machines" this evening, which involves the development of plug-ins for Eclipse startup time detection
So turned over the information, but also developed a plug-in
It was started after development.
The start-up time is more than 13s, then I developed the process for everyone to reference
The first step creates a new plug-in project file
Generate an activator in the second step tick
The third step is to write a Showtime.java file
Package com.developer.showtime;
Import Org.eclipse.jface.dialogs.MessageDialog;
Import Org.eclipse.swt.widgets.Display;
Import Org.eclipse.swt.widgets.Shell;
Import Org.eclipse.ui.IStartup;
public class ShowTime implements istartup{
@Override
public void Earlystartup () {
Display. Getdefault (). Syncexec (New Runnable () {
@Override
public void Run () {
TODO auto-generated Method Stub
Long eclipsestarttime = Long.parselong (System.getproperty ("Eclipse.starttime"));
Long costtime = System.currenttimemillis ()-eclipsestarttime;
Shell shell = Display.getdefault (). Getactiveshell ();
String message = "Eclipse start in" + Costtime + "MS";
Messagedialog. Openinformation (Shell, "information", message);
}
});
}
}
This is my own.
Found an error
Add one after bundle-symbolicname:com.developer.showtime; singleton:=true
Configuration under Plugin.xml
<?xml version= "1.0" encoding= "UTF-8"?>
<?eclipse version= "3.5"?>
<plugin>
<extension point= "Org.eclipse.ui.startup" >
<startup class= "Com.developer.showtime.ShowTime"/>
</extension>
</plugin>
You can now run as---eclipse application, which launches a new eclipse and runs the plug-in, and then you can export the plugin after success.
Do you want to make a plug-in like this? Give it a try.
Plug-in development for eclipse-startup time