looking into slowdowns

This commit is contained in:
Ben Fry
2021-07-09 09:27:16 -04:00
parent add4854478
commit 3a12d49e78
8 changed files with 90 additions and 11 deletions

View File

@@ -104,6 +104,8 @@ public class JavaEditor extends Editor {
Mode mode) throws EditorException {
super(base, path, state, mode);
// long t1 = System.currentTimeMillis();
jmode = (JavaMode) mode;
debugger = new Debugger(this);
@@ -139,6 +141,8 @@ public class JavaEditor extends Editor {
pdexEnabled = !hasJavaTabs();
// long t5 = System.currentTimeMillis();
usage = new ShowUsage(this, preprocService);
inspect = new InspectMode(this, preprocService, usage);
rename = new Rename(this, preprocService, usage);
@@ -149,12 +153,16 @@ public class JavaEditor extends Editor {
errorChecker = new ErrorChecker(this, preprocService);
// long t7 = System.currentTimeMillis();
for (SketchCode code : getSketch().getCode()) {
Document document = code.getDocument();
addDocumentListener(document);
}
sketchChanged();
// long t9 = System.currentTimeMillis();
Toolkit.setMenuMnemonics(textarea.getRightClickPopup());
// ensure completion is hidden when editor loses focus
@@ -165,6 +173,9 @@ public class JavaEditor extends Editor {
public void windowGainedFocus(WindowEvent e) { }
});
// long t10 = System.currentTimeMillis();
// System.out.println("java editor was " + (t10-t9) + " " + (t9-t7) + " " + (t7-t5) + " " + (t5-t1));
}