Permalink
Browse files

use long running build1 for performance

  • Loading branch information...
1 parent b4faa96 commit 6b8c248a3d41d17932e578de3e6df496506ad89a @JPMoresmau committed Jan 28, 2013
@@ -383,7 +383,11 @@ private void addEditorStanza(IFile file,List<String> command){
if (end){
p.getOutputStream().write(endCommand);
- p.getOutputStream().flush();
+ try {
+ p.getOutputStream().flush();
+ } catch (IOException ignore){
+ // noop: flush fails if the process closed properly because write flush
+ }
buildProcesses.remove(file);
}
if (logBuildTimes){
@@ -218,7 +218,7 @@ protected IStatus run(IProgressMonitor monitor) {
* @param handler
* @param ndhandler
*/
- public void updateFromEditor(final IFile file,final OutlineHandler handler,final NameDefHandler ndhandler){
+ public void updateFromEditor(final IFile file,final OutlineHandler handler,final NameDefHandler ndhandler,final boolean sync1,final boolean end){
final String jobNamePrefix = NLS.bind(BWText.editor_job_name, getProject().getName());
/*
@@ -236,23 +236,25 @@ protected IStatus run(IProgressMonitor monitor) {
long t0=System.currentTimeMillis();
if (needSynchronize){
realFacade.synchronize(false);
+ } else if (sync1){
+ realFacade.synchronize1(file, true);
}
long t1=System.currentTimeMillis();
- OutlineResult or=realFacade.outline(file);
- long t2=System.currentTimeMillis();
- handler.handleOutline(or); // avoid removing all outline on error
-
+ if (handler!=null){
+ OutlineResult or=realFacade.outline(file);
+ handler.handleOutline(or); // avoid removing all outline on error
+ }
long t3=System.currentTimeMillis();
- Collection<NameDef> ns=realFacade.build1LongRunning(file,false);
+ Collection<NameDef> ns=realFacade.build1LongRunning(file,end);
long t35=System.currentTimeMillis();
if (ndhandler!=null){
ndhandler.handleNameDefs(ns);
}
if (BWFacade.logBuildTimes){
long t4=System.currentTimeMillis();
- BuildWrapperPlugin.logInfo("sync:"+(t1-t0)+",outline:"+(t2-t1)+"ms,handleroutline:"+(t3-t2)+"ms,build:"+(t35-t3)+"ms,handleNameDefs:"+(t4-t35)+"ms");
+ BuildWrapperPlugin.logInfo("sync:"+(t1-t0)+"ms,outline:"+(t3-t1)+"ms,build:"+(t35-t3)+"ms,handleNameDefs:"+(t4-t35)+"ms");
}
} finally {
monitor.done();
@@ -483,7 +483,7 @@ public void dispose() {
final IFile file=findFile();
if (file!=null){
HaskellCorePlugin.getModifiedByEditors().remove( file );
- final BWFacade f=BuildWrapperPlugin.getFacade( findFile().getProject() );
+ /*final BWFacade f=BuildWrapperPlugin.getFacade( findFile().getProject() );
if (f!=null){
new Thread(new Runnable() {
@@ -496,6 +496,10 @@ public void run() {
}
}).start();
+ }*/
+ JobFacade jf=BuildWrapperPlugin.getJobFacade( file.getProject() );
+ if (jf!=null){
+ jf.updateFromEditor( file, null, null, true, true );
}
}
@@ -700,7 +704,7 @@ public void synchronize(){
needWrite=true;
}*/
//needWrite?getDocument():null
- jf.updateFromEditor( file, outlineHandler,this );
+ jf.updateFromEditor( file, outlineHandler,this,false,false );
/*if (!isDirty()){ // now we've written and not dirty
needWrite=false;
}*/

0 comments on commit 6b8c248

Please sign in to comment.