Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.PerformanceStats


            presentation.createPartControl(container);
            // do not create the standby part here for performance.
        }

        if (Log.logPerformance) {
            PerformanceStats stats = PerformanceStats.getStats(
                IIntroConstants.PERF_UI_ZOOM, IIntroConstants.INTRO);
            stats.startRun();
        }

    }
View Full Code Here


    ITypeRoot typeRoot,
    IProgressMonitor monitor) throws JavaModelException {
  if (requestor == null) {
    throw new IllegalArgumentException("Completion requestor cannot be null"); //$NON-NLS-1$
  }
  PerformanceStats performanceStats = CompletionEngine.PERF
    ? PerformanceStats.getStats(JavaModelManager.COMPLETION_PERF, this)
    : null;
  if(performanceStats != null) {
    performanceStats.startRun(new String(cu.getFileName()) + " at " + position); //$NON-NLS-1$
  }
  IBuffer buffer = getBuffer();
  if (buffer == null) {
    return;
  }
  if (position < -1 || position > buffer.getLength()) {
    throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INDEX_OUT_OF_BOUNDS));
  }
  JavaProject project = (JavaProject) getJavaProject();
  SearchableEnvironment environment = project.newSearchableNameEnvironment(owner);

  // set unit to skip
  environment.unitToSkip = unitToSkip;

  // code complete
  CompletionEngine engine = new CompletionEngine(environment, requestor, project.getOptions(true), project, owner, monitor);
  engine.complete(cu, position, 0, typeRoot);
  if(performanceStats != null) {
    performanceStats.endRun();
  }
  if (NameLookup.VERBOSE) {
    System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " + environment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
    System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " + environment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

    System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " + environment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
    System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " + environment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
  }
}
protected IJavaElement[] codeSelect(org.eclipse.jdt.internal.compiler.env.ICompilationUnit cu, int offset, int length, WorkingCopyOwner owner) throws JavaModelException {
  PerformanceStats performanceStats = SelectionEngine.PERF
    ? PerformanceStats.getStats(JavaModelManager.SELECTION_PERF, this)
    : null;
  if(performanceStats != null) {
    performanceStats.startRun(new String(cu.getFileName()) + " at [" + offset + "," + length + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
  }

  JavaProject project = (JavaProject)getJavaProject();
  SearchableEnvironment environment = project.newSearchableNameEnvironment(owner);

  SelectionRequestor requestor= new SelectionRequestor(environment.nameLookup, this);
  IBuffer buffer = getBuffer();
  if (buffer == null) {
    return requestor.getElements();
  }
  int end= buffer.getLength();
  if (offset < 0 || length < 0 || offset + length > end ) {
    throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INDEX_OUT_OF_BOUNDS));
  }

  // fix for 1FVXGDK
  SelectionEngine engine = new SelectionEngine(environment, requestor, project.getOptions(true), owner);
  engine.select(cu, offset, offset + length - 1);

  if(performanceStats != null) {
    performanceStats.endRun();
  }
  if (NameLookup.VERBOSE) {
    System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " + environment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
    System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " + environment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.PerformanceStats

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.