Git Product home page Git Product logo

ide-perf's Introduction

build status plugin version

IDE Perf: Performance diagnostics for IntelliJ Platform

This is a plugin for IntelliJ-based IDEs that gives real-time insight into the performance of the IDE itself. You can install it from the JetBrains Plugin Repository, then see the user guide for usage instructions. Feel free to file an issue if you find a bug or have a feature request. Note: this is not an officially supported Google product.

Features

  • Method tracer: choose some methods, then get call counts and overhead measurements in real time as the IDE is being used. Methods are traced on-the-fly using bytecode instrumentation. There is both a method list view and a call tree view. Tracing commands are auto-completed as you type. Tracing overhead is low (approx. 200 ns per call).

  • Parameter tracer: track how many times a method is called with a specific argument. For example, you can trace the first parameter of JavaPsiFacade.findClass to visualize class search queries.

  • CachedValue tracer: track CachedValue hit ratios in real time.

Here is a screenshot of the method tracer:

screenshot

Comparison to other tools

A batch profiler such as YourKit is still the first tool you should reach for when diagnosing an unknown performance issue. However, IDE Perf is useful when you want to dig deeper into a specific issue.

Advantages

  • IDE Perf displays data in real time. This is useful in user-interactive scenarios because you will notice patterns in the way the data changes in response to specific user actions.

  • Tracing is targeted at only a small set of methods that you care about. This leads to low tracing overhead, accurate time measurements, and low visual clutter when looking at the call tree.

  • IDE Perf can surface IntelliJ-specific diagnostics such as CachedValue statistics.

Example use cases

  • Use the tracer to get call counts when CPU sampling is insufficient.

  • Use the tracer to accurately measure the effect of a performance optimization.

  • Use wildcard tracing to audit a new feature and look for unexpected overhead.

  • Given a user-reported performance bug, search for repro scenarios by tracing suspect methods and then monitoring the tracing data while trying out a variety of user interactions.

Contributing

See dev-guide.md for development tips, and see CONTRIBUTING.md before submitting a pull request. If you plan to make any large-scale changes, it is a good idea to start a discussion first! If you need ideas on what to implement, check out the "future work" discussion here.

ide-perf's People

Contributors

eugen-yakovets avatar gharrma avatar josh-127 avatar vladimirdolzhenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ide-perf's Issues

VFS Tracer broke

Worse, the error message is unreadable (the text is confined to an itty-bitty square somehow). However, thanks to the UI Inspector, I can recover the HTML for the error message. (The whitespace was somewhat mangled, so I've tweaked it.)

<html>
   <head>
     <style type="text/css">
       <!--
         body { font-family: Segoe UI; font-size: 12pt; color: #d4d4d4 }
         div { font-family: Segoe UI; font-size: 12pt; color: #d4d4d4 }
         td { font-family: Segoe UI; font-size: 12pt; color: #d4d4d4 }
         p { font-family: Segoe UI; font-size: 12pt; color: #d4d4d4 }
         a { font-family: Segoe UI; font-size: 12pt; color: #ede891 }
         code { font-size: 12pt }
         ul { list-style: disc; margin-left: 15px }
       -->
     </style>
   </head>
   <body>
     Detected a breaking change. Cannot find
      com.intellij.psi.stubs.StubIndexImpl::createPsiNoLock.
   </body>
 </html> 

However, it seems that this instance of createPsiNoLock is a copy and paste error: the method in question is actually named processElements:

if (name != "processElements" || descriptor != "(Lcom/intellij/psi/stubs/StubIndexKey;Ljava/lang/Object;Lcom/intellij/openapi/project/Project;Lcom/intellij/psi/search/GlobalSearchScope;Lcom/intellij/util/indexing/IdFilter;Ljava/lang/Class;Lcom/intellij/util/Processor;)Z") {

It looks like this got moved to com.intellij.psi.stubs.StubIndexEx#processElements in commit
JetBrains/intellij-community@7aa4148.

About USE

Could you provide some more detailed usage tutorials?

ClassNotFoundException in MethodTracerCommandPredictor.predictMethodToken

@josh-127 I tried to add you as the "assignee", but GitHub wouldn't let me for some reason. So tagging you here instead!

2020-06-25 22:20:59,582 [ 300146]  ERROR - on.CompletionProgressIndicator - com.intellij.openapi.progress.ProgressManage PluginClassLoader[com.google.ide-perf, 1.0-SNAPSHOT] com.intellij.ide.plugins.cl.PluginClassLoader@1c899759 
java.lang.ClassNotFoundException: com.intellij.openapi.progress.ProgressManage PluginClassLoader[com.google.ide-perf, 1.0-SNAPSHOT] com.intellij.ide.plugins.cl.PluginClassLoader@1c899759
	at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:115)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:315)
	at com.google.idea.perf.methodtracer.MethodTracerCommandPredictor.predictMethodToken(MethodTracerCommandPredictor.kt:71)
	at com.google.idea.perf.methodtracer.MethodTracerCommandPredictor.predict(MethodTracerCommandPredictor.kt:52)
	at com.google.idea.perf.CommandCompletionProvider.fillCompletionVariants(CommandCompletionProvider.kt:70)
	at com.intellij.util.textCompletion.TextCompletionContributor.fillCompletionVariants(TextCompletionContributor.java:58)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:76)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:59)
	at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:132)
	at com.intellij.codeInsight.completion.BaseCompletionService.performCompletion(BaseCompletionService.kt:30)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.calculateItems(CompletionProgressIndicator.java:834)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.runContributors(CompletionProgressIndicator.java:819)
	at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$null$6(CodeCompletionHandlerBase.java:332)
	at com.intellij.codeInsight.completion.AsyncCompletion.lambda$tryReadOrCancel$5(CompletionThreading.java:172)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1106)
	at com.intellij.codeInsight.completion.AsyncCompletion.tryReadOrCancel(CompletionThreading.java:170)
	at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$startContributorThread$7(CodeCompletionHandlerBase.java:324)
	at com.intellij.codeInsight.completion.AsyncCompletion.lambda$null$0(CompletionThreading.java:95)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:625)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:570)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
	at com.intellij.codeInsight.completion.AsyncCompletion.lambda$startThread$1(CompletionThreading.java:91)
	at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
	at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:255)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Exception when typing class names: "Light files should have PSI only in one project"

Repro steps:

  1. Type trace and any class name
  2. The following exception occurs
2021-01-29 16:36:41,620 [ 496903]  ERROR - impl.file.impl.FileManagerImpl - Light files should have PSI only in one project, existing=com.intellij.psi.SingleRootFileViewProvider{vFile=LightVirtualFile: /Dummy.txt, content=VirtualFileContent{size=0}, eventSystemEnabled=true} in com.intellij.openapi.project.impl.DefaultProject@4, requested in Project(name=android-crash, containerState=COMPONENT_CREATED, componentStore=/Users/yiyiyang/ApkProjects/android-crash) 
java.lang.Throwable: Light files should have PSI only in one project, existing=com.intellij.psi.SingleRootFileViewProvider{vFile=LightVirtualFile: /Dummy.txt, content=VirtualFileContent{size=0}, eventSystemEnabled=true} in com.intellij.openapi.project.impl.DefaultProject@4, requested in Project(name=android-crash, containerState=COMPONENT_CREATED, componentStore=/Users/yiyiyang/ApkProjects/android-crash)
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:159)
	at com.intellij.psi.impl.file.impl.FileManagerImpl.checkHasNoOtherPsi(FileManagerImpl.java:205)
	at com.intellij.psi.impl.file.impl.FileManagerImpl.findViewProvider(FileManagerImpl.java:194)
	at com.intellij.psi.impl.file.impl.FileManagerImpl.findFile(FileManagerImpl.java:368)
	at com.intellij.psi.impl.PsiDocumentManagerBase.getPsiFile(PsiDocumentManagerBase.java:142)
	at com.intellij.psi.impl.PsiDocumentManagerBase.getPsiFile(PsiDocumentManagerBase.java:93)
	at com.intellij.psi.impl.PsiDocumentManagerImpl.getPsiFile(PsiDocumentManagerImpl.java:64)
	at com.intellij.ide.actions.CopyElementAction.updateForEditor(CopyElementAction.java:98)
	at com.intellij.ide.actions.CopyElementAction.update(CopyElementAction.java:79)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:178)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.doUpdate(ActionUpdater.java:465)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$new$1(ActionUpdater.java:94)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.java:134)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$new$2(ActionUpdater.java:95)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.update(ActionUpdater.java:447)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:297)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$19(ActionUpdater.java:276)
	at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1599)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:276)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroup(ActionUpdater.java:186)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroup(ActionUpdater.java:160)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$expandActionGroupWithTimeout$11(ActionUpdater.java:202)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:59)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:59)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.withTimeout(ProgressIndicatorUtils.java:306)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroupWithTimeout(ActionUpdater.java:202)
	at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroupWithTimeout(Utils.java:88)
	at com.intellij.ui.mac.touchbar.TouchBar.updateActionItems(TouchBar.java:460)
	at com.intellij.ui.mac.touchbar.TouchBar.onBeforeShow(TouchBar.java:329)
	at com.intellij.ui.mac.touchbar.StackTouchBars$TouchBarHolder._setNextTouchBar(StackTouchBars.java:156)
	at com.intellij.ui.mac.touchbar.StackTouchBars$TouchBarHolder.lambda$setTouchBar$0(StackTouchBars.java:140)
	at java.desktop/javax.swing.Timer.fireActionPerformed(Timer.java:317)
	at java.desktop/javax.swing.Timer$DoPostEvent.run(Timer.java:249)
	at java.desktop/java.awt.event.InvocationEvent.dispatch$$$capture(InvocationEvent.java:313)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:976)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:843)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:773)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:828)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:507)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
2021-01-29 16:36:41,620 [ 496903]  ERROR - impl.file.impl.FileManagerImpl - Android Studio dev build  Build #AI-203.7148.57.2031.SNAPSHOT 
2021-01-29 16:36:41,623 [ 496906]  ERROR - impl.file.impl.FileManagerImpl - JDK: 11.0.8; VM: OpenJDK 64-Bit Server VM; Vendor: N/A 
2021-01-29 16:36:41,623 [ 496906]  ERROR - impl.file.impl.FileManagerImpl - OS: Mac OS X 
2021-01-29 16:36:41,624 [ 496907]  ERROR - impl.file.impl.FileManagerImpl - Last Action: EditorChooseLookupItem 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.