private static void updateAllActionsInner(@NotNull Project project,
                                            @NotNull Component component,
                                            @NotNull MyRunner activityRunner) {
    ActionManagerImpl actionManager = (ActionManagerImpl)ActionManager.getInstance();
    List<Pair<Integer, String>> results = new ArrayList<>();

    DataContext rawContext = DataManager.getInstance().getDataContext(component);

    PsiManager.getInstance(project).dropPsiCaches();
    PsiManager.getInstance(project).dropResolveCaches();
    ActionToolbarImpl.resetAllToolbars();

    LOG.info("Benchmarking actions update for component: " + component.getClass().getName());

    long startContext = System.nanoTime();
    DataContext wrappedContext = Utils.createAsyncDataContext(rawContext);
    LOG.info(TimeoutUtil.getDurationMillis(startContext) + " ms to create data-context");

    long startPrecache = System.nanoTime();
    ReadAction.run(() -> {
      for (DataKey<?> key : DataKey.allKeys()) {
        activityRunner.run("DataContext(\"" + key.getName() + "\")", null, () -> wrappedContext.getData(key));
      }
    });
    LOG.info(TimeoutUtil.getDurationMillis(startPrecache) + " ms to pre-cache data-context");
    Set<String> nonUniqueClasses = new HashSet<>();
    {
      Set<String> visited = new HashSet<>();
      for (Iterator<AnAction> it = actionManager.actions(false).iterator(); it.hasNext(); ) {
        AnAction action = it.next();
        if (action.getClass() == DefaultActionGroup.class) {
          continue;
        }
        String className = action.getClass().getName();
        if (!visited.add(className)) {
          nonUniqueClasses.add(className);
        }
      }
    }

    int count = 0;
    long startActions = System.nanoTime();
    for (Iterator<AnAction> it = actionManager.actions(false).iterator(); it.hasNext(); ) {
      AnAction action = it.next();
      if (action.getClass() == DefaultActionGroup.class || !DumbService.getInstance(project).isUsableInCurrentContext(action)) {
        continue;
      }

      String id = actionManager.getId(action);

      String className = action.getClass().getName();
      String actionIdIfNeeded = nonUniqueClasses.contains(className) ? " (" + id + ")" : "";
      String actionName = className + actionIdIfNeeded;
      ProgressManager.checkCanceled();
      AnActionEvent event = AnActionEvent.createFromAnAction(action, null, ActionPlaces.MAIN_MENU, wrappedContext);
      runAndMeasure(results, actionName,
                    () -> activityRunner.run(actionName, id, () -> ActionUtil.performDumbAwareUpdate(action, event, true)));
      count++;
      if (!(action instanceof ActionGroup)) continue;
      String childrenActionName = className + ".getChildren(" + (event.getPresentation().isEnabled() ? "+" : "-") + ")" + actionIdIfNeeded;
      runAndMeasure(results, childrenActionName,
                    () -> activityRunner.run(actionName, id, () -> ((ActionGroup)action).getChildren(event)));
    }
    long elapsedActions = TimeoutUtil.getDurationMillis(startActions);
    LOG.info(elapsedActions + " ms total to update " + count + " registered actions");
    results.sort(Comparator.comparingInt(o -> -o.first));
    for (Pair<Integer, String> result : results) {
      if (result.first < MIN_REPORTED_UPDATE_MILLIS) break;
      LOG.info(result.first + " ms - " + result.second);
    }
    dumpActionUpdateThreads(nonUniqueClasses);
  }
private static void updateAllActionsInner(@NotNull Project project,
                                            @NotNull Component component,
                                            @NotNull MyRunner activityRunner)