Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.PerformanceStats


}
protected void codeComplete(org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit cu, org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit unitToSkip, int position, CompletionRequestor requestor, WorkingCopyOwner owner) 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);
  engine.complete(cu, position, 0);
  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.aspectj.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));
  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

      try {
        // plugin must be active to get computer
        ICompletionProposalComputer computer = getComputer(true);
        if (computer != null) {
          try {
            PerformanceStats stats= startMeter(context, computer);
            //ask the computer for the proposals
            List proposals = computer.computeCompletionProposals(context, monitor);
            stopMeter(stats, COMPUTE_COMPLETION_PROPOSALS);
   
            if (proposals != null) {
View Full Code Here

      IStatus status = null;
      try {
        // plugin must be active to get computer
        ICompletionProposalComputer computer = getComputer(true);
        if (computer != null) {
          PerformanceStats stats= startMeter(context, computer);
          List proposals= computer.computeContextInformation(context, monitor);
          stopMeter(stats, COMPUTE_CONTEXT_INFORMATION);
   
          if (proposals != null) {
            fLastError= computer.getErrorMessage();
View Full Code Here

      IStatus status = null;
      try {
        // plugin must be active to get computer
        ICompletionProposalComputer computer = getComputer(true);
        if (computer != null) {
          PerformanceStats stats = startMeter(SESSION_STARTED, computer);
          computer.sessionStarted();
          stopMeter(stats, SESSION_ENDED);
        }
      } catch (InvalidRegistryObjectException x) {
        status= createExceptionStatus(x);
View Full Code Here

      IStatus status = null;
      try {
        // plugin must be active to get computer
        ICompletionProposalComputer computer = getComputer(true);
        if (computer != null) {
          PerformanceStats stats= startMeter(SESSION_ENDED, computer);
          computer.sessionEnded();
          stopMeter(stats, SESSION_ENDED);
        }
      } catch (InvalidRegistryObjectException x) {
        status= createExceptionStatus(x);
View Full Code Here

   * @param context
   * @param computer
   * @return
   */
  private PerformanceStats startMeter(Object context, ICompletionProposalComputer computer) {
    final PerformanceStats stats;
    if (MEASURE_PERFORMANCE) {
      stats= PerformanceStats.getStats(PERFORMANCE_EVENT, computer);
      stats.startRun(context.toString());
    } else {
      stats= null;
    }

    if (fIsReportingDelay) {
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

     * doStandbyStateChanged instead.
     *
     * @param standby
     */
    public void standbyStateChanged(boolean standby, boolean isStandbyPartNeeded) {
        PerformanceStats setStandbyStateStats = null;
        long start = 0;
        if (Log.logPerformance) {
            if (logUIcreationTime && PerformanceStats.ENABLED) {
                PerformanceStats stats = PerformanceStats.getStats(
                    IIntroConstants.PERF_UI_ZOOM, IIntroConstants.INTRO);
                stats.endRun();
                Util
                    .logPerformanceMessage(
                        "(perf stats) time spent in UI code before content is displayed (standbyStateChanged event is fired) ", //$NON-NLS-1$
                        stats.getRunningTime());
                stats.reset();
            }

            // standby time.
            setStandbyStateStats = PerformanceStats.getStats(
                IIntroConstants.PERF_SET_STANDBY_STATE, IIntroConstants.INTRO);
            setStandbyStateStats.startRun();
            start = System.currentTimeMillis();
        }


        doStandbyStateChanged(standby, isStandbyPartNeeded);

        // now log performance
        if (Log.logPerformance) {
            if (PerformanceStats.ENABLED) {
                setStandbyStateStats.endRun();
                Util
                    .logPerformanceMessage(
                        "(perf stats) setting standby state (zooming, displaying content) took:", //$NON-NLS-1$
                        +setStandbyStateStats.getRunningTime());
                setStandbyStateStats.reset();
            } else
                Util
                    .logPerformanceTime(
                        "setting standby state (zooming, generating content, setText() ) took:", //$NON-NLS-1$
                        +start);

            if (logUIcreationTime) {
                if (PerformanceStats.ENABLED) {
                    PerformanceStats stats = PerformanceStats.getStats(
                        IIntroConstants.PERF_VIEW_CREATION_TIME,
                        IIntroConstants.INTRO);
                    stats.endRun();
                    Util
                        .logPerformanceMessage(
                            "END - (perf stats): creating CustomizableIntroPart view took:", //$NON-NLS-1$
                            +stats.getRunningTime());
                    stats.reset();
                } else
                    Util.logPerformanceTime(
                        "END: creating CustomizableIntroPart view took:", //$NON-NLS-1$
                        +IntroPlugin.getDefault().gettUICreationStartTime());

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.