计算耗时比率.

@param performanceVOList
348615
protected void ratio(List<MethodDto> performanceVOList, String entryName) {
		double allTotalTime = this.getAllTotalTime(performanceVOList, entryName);
		Map<String, Double> interfaceTotalTimeMap = this.getInterfaceTotalTime(performanceVOList);
		for (MethodDto performanceVO : performanceVOList) {
			String interfaceName = performanceVO.getInterfaceName();
			Double interfaceTotalTime = interfaceTotalTimeMap.get(interfaceName);

			double interfaceRatio = this.percent(performanceVO.getAllTime(), interfaceTotalTime);
			double timeRatio = this.percent(performanceVO.getAllTime(), allTotalTime);

			performanceVO.setInterfaceRatio(interfaceRatio);
			performanceVO.setTimeRatio(timeRatio);
		}
	}
39425
public static void stringEquals(MethodVisitor mv, Runnable load, String content, Label next,
                                    Runnable success) {
        // 加载String
        load.run();
        // 加载实际方法名
        mv.visitLdcInsn(content);
        // 调用String的equals方法
        mv.visitMethodInsn(INVOKEVIRTUAL, convert(String.class), "equals",
            ByteCodeUtils.getMethodDesc(MethodConst.EQUALAS_METHOD), false);
        // 如果结果为false则跳转到下一个
        mv.visitJumpInsn(IFEQ, next);
        success.run();
    }
817275
public List<Rc> sortByTitleAndFilterDoubles(List<Rc> rcList) {
    List<Rc> result = new ArrayList<Rc>();
    List<Rc> sorted = new ArrayList<Rc>();
    sorted.addAll(rcList);
    Collections.sort(sorted, new Comparator<Rc>() {
      @Override
      public int compare(Rc lRc, Rc rRc) {
        int result = lRc.getTitle().compareTo(rRc.getTitle());
        if (result == 0) {
          result = rRc.getTimestamp().compare(lRc.getTimestamp());
        }
        return result;
      }
    });
    Rc previous = null;
    for (Rc rc : sorted) {
      if (previous == null || (!rc.getTitle().equals(previous.getTitle()))) {
        result.add(rc);
      }
      previous = rc;
    }
    Collections.sort(result, new Comparator<Rc>() {
      @Override
      public int compare(Rc lRc, Rc rRc) {
        int result = rRc.getTimestamp().compare(lRc.getTimestamp());
        return result;
      }
    });
    return result;
  }
950482
function (name, type, callback) {
        var that = this;
        var performRequest = function () {
            if (!that.HasSparkVariable(name)) {
                callback(null, null, "Variable not found");
                return;
            }

            var token = this.sendMessage("VariableRequest", { name: name });
            var varTransformer = this.transformVariableGenerator(name, callback);
            this.listenFor("VariableValue", null, token, varTransformer, true);
        }.bind(this);

        if (this.hasFnState()) {
            //slight short-circuit, saves ~5 seconds every 100,000 requests...
            performRequest();
        }
        else {
            when(this.ensureWeHaveIntrospectionData())
                .then(
                    performRequest,
                    function (err) { callback(null, null, "Problem requesting variable: " + err);
                });
        }
    }
950390
public void setResourceTypeList(java.util.Collection<String> resourceTypeList) {
        if (resourceTypeList == null) {
            this.resourceTypeList = null;
            return;
        }

        this.resourceTypeList = new java.util.ArrayList<String>(resourceTypeList);
    }
1099279
function(invokeId, errType, resultStr) {
    if (!invoked) return
    var diffMs = hrTimeMs(process.hrtime(start))
    var billedMs = Math.min(100 * (Math.floor(diffMs / 100) + 1), TIMEOUT * 1000)
    systemLog('END RequestId: ' + invokeId)
    systemLog([
      'REPORT RequestId: ' + invokeId,
      'Duration: ' + diffMs.toFixed(2) + ' ms',
      'Billed Duration: ' + billedMs + ' ms',
      'Memory Size: ' + MEM_SIZE + ' MB',
      'Max Memory Used: ' + Math.round(process.memoryUsage().rss / (1024 * 1024)) + ' MB',
      '',
    ].join('\t'))

    var exitCode = errored || errType ? 1 : 0
    if (typeof resultStr === 'string') {
      handleResult(resultStr, function() { process.exit(exitCode) })
    } else {
      process.exit(exitCode)
    }
  }
144164
public List<ProcessInstance> executeList(CommandContext commandContext, Map<String, Object> parameterMap, int firstResult, int maxResults) {
    return commandContext.getExecutionEntityManager().findProcessInstanceByNativeQuery(parameterMap, firstResult, maxResults);
  }
219242
@Override
  public void computeDensityEstimator(List<S> solutionList) {
    int size = solutionList.size();

    if (size <= solutionList.get(0).getNumberOfObjectives()) {
      for (int x = 0; x < size; x++) {
        solutionList.get(x).setAttribute(getAttributeID(), Double.POSITIVE_INFINITY);
      }
      return;
    }

    // Use a new SolutionSet to avoid altering the original solutionSet
    List<S> front = new ArrayList<>(size);
    for (S solution : solutionList) {
      front.add(solution);
    }

    for (int i = 0; i < size; i++) {
      front.get(i).setAttribute(getAttributeID(), 0.0);
    }

    int numberOfObjectives = solutionList.get(0).getNumberOfObjectives();

    double objetiveMaxn[] = new double[numberOfObjectives];
    double objetiveMinn[] = new double[numberOfObjectives];
    double distan;

    for (int i = 0; i < numberOfObjectives; i++) {
      // Sort the population by Obj n
      Collections.sort(front, new ObjectiveComparator<S>(i));
      objetiveMinn[i] = front.get(0).getObjective(i);
      objetiveMaxn[i] = front.get(front.size() - 1).getObjective(i);

      // Set de crowding distance Los extremos si infinitos
      front.get(0).setAttribute(getAttributeID(), Double.POSITIVE_INFINITY);
      front.get(size - 1).setAttribute(getAttributeID(), Double.POSITIVE_INFINITY);
    }
    double[][] distance =
        SolutionListUtils.distanceMatrix_normalize(front, objetiveMaxn, objetiveMinn);

    double dminn, dmaxx;
    dminn = Double.MAX_VALUE;
    dmaxx = 0.0;
    for (int i = 0; i < distance.length; i++)
      for (int j = 0; j < distance.length; j++) {
        if (i != j) {
          if (distance[i][j] < dminn) {
            dminn = distance[i][j];
          }
          if (distance[i][j] > dmaxx) {
            dmaxx = distance[i][j];
          }
        }
      }

    for (int i = 0; i < front.size(); i++) {
      double temp = 0.0;
      for (int j = 0; j < distance.length; j++) {
        if (i != j) {
          temp += Math.pow(distance[i][j] - (dmaxx - dminn), 2);
        }
      }
      temp /= distance.length - 1;
      temp = Math.sqrt(temp);
      temp *= -1;
      temp += (double) front.get(i).getAttribute(getAttributeID());
      // if((double) front.get(i).getAttribute(getAttributeID())!=Double.POSITIVE_INFINITY)
      front.get(i).setAttribute(getAttributeID(), temp);
    }

    // int k = numberOfObjectives la solucion 0 es ella misma
    for (int i = 0; i < distance.length; i++) {
      Arrays.sort(distance[i]);
      double kDistance = 0.0;
      for (int k = numberOfObjectives; k > 0; k--) {
        // kDistance += (dmaxx-dminn) / (distance[i][k]);//me gusta mas este
        // kDistance += (dmaxx-dminn) / (distance[i][k]+dminn);//original
        kDistance += (dmaxx - dminn) / distance[i][k];
      }
      double temp = (double) front.get(i).getAttribute(getAttributeID());
      // if(temp!=Double.POSITIVE_INFINITY)
      // kDistance=kDistance/numberOfObjectives-1;
      temp -= kDistance;
      front.get(i).setAttribute(getAttributeID(), temp);
    }
  }
1286712
void displayResult(CmsSolrResultList resultList) {

        List<CmsResource> resources;
        evalSeries(resultList);
        if (m_hideSeriesInstances) {
            Set<CmsUUID> instanceIds = new HashSet<CmsUUID>();
            resources = new ArrayList<CmsResource>();
            for (CmsSearchResource res : resultList) {
                if (!instanceIds.contains(res.getStructureId())) {
                    instanceIds.add(res.getStructureId());
                    resources.add(res);
                }
            }
        } else {
            resources = new ArrayList<CmsResource>(resultList);
        }
        m_resultTable.fillTable(A_CmsUI.getCmsObject(), resources, true, false);
        String state = A_CmsWorkplaceApp.addParamToState(
            "",
            CmsEditor.RESOURCE_ID_PREFIX,
            m_currentResource.getStructureId().toString());
        state = A_CmsWorkplaceApp.addParamToState(
            state,
            PARAM_LOCALE,
            m_currentConfigParser.getSearchLocale().toString());
        m_currentState = state;
        CmsAppWorkplaceUi.get().changeCurrentAppState(state);
        if (m_isOverView) {
            enableOverviewMode(false);
            updateBreadCrumb(getBreadCrumbForState(state));
        }
    }
1155273
private Boolean compareListValues( // was BooleanValue
      Object firstVal,
      Object secondVal,
      boolean lessThan,
      boolean permissive,
      boolean overallTrue) // If true we are searching for at least one TRUE result, else at least one FALSE.
    {
      if (tc.isAnyTracingEnabled() && tc.isEntryEnabled())
        tc.entry(cclass, 
                 "compareListValues", 
                 new Object[] { firstVal, 
                                secondVal, 
                                new Boolean(lessThan), 
                                new Boolean(permissive), 
                                new Boolean(overallTrue) });
      
      Boolean finalReturn = null;
      // Drive the compare() method
      Boolean compReturn = compare(firstVal, secondVal, lessThan, permissive);
      if(compReturn != null)
      {
        if(overallTrue)
        {
          if (compReturn.equals(Boolean.TRUE))
          {
            // We've found a pair that meet the criteria
            finalReturn = Boolean.TRUE;
          }
        }
        else
        {
          if (compReturn.equals(Boolean.FALSE))
          {
            // We've found a pair that meet the criteria
            finalReturn = Boolean.TRUE;
          }
        }
      }            

      if (tc.isAnyTracingEnabled() && tc.isEntryEnabled())
        tc.exit(cclass, "compareListValues", finalReturn);       
      return finalReturn;
    }
1017584
@Override
  public int compareTo(final SysEvent val) {
    if (val == null) {
      return 1;
    }
    return (sysCode.compareTo(val.sysCode));
  }
289787
@Override
    public int compareTo(final Outcome other) {
        return Data.getTotalComparator().compare(this.invocationID, other.invocationID);
    }
381533
function Comparison (driver, comparisonList) {
	this._driver = driver;

	this._comparisons = {};
	comparisonList.forEach(function (comparison) {
		this._loadComparison(comparison);
	}.bind(this));
}
874337
private void sortCandidateList(ArrayList list) {
    java.util.Collections.sort(list, new java.util.Comparator() {
      public int compare(Object o1, Object o2) {
        // First sort, by score in index
        double scoreT = ( (Candidates) o1).getScore(),
            scoreU = ( (Candidates) o2).getScore();
        if (scoreU > scoreT) {
          return 1;
        }
        if (scoreU < scoreT) {
          return -1;
        }
        return 0;
      }
    }
    );
  }
37741
public void findMatch(ArrayList<String> speechResult) {

        loadCadidateString();

        for (String matchCandidate : speechResult) {

            Locale localeDefault = mGvrContext.getActivity().getResources().getConfiguration().locale;
            if (volumeUp.equals(matchCandidate)) {
                startVolumeUp();
                break;
            } else if (volumeDown.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) {
                startVolumeDown();
                break;
            } else if (zoomIn.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) {
                startZoomIn();
                break;
            } else if (zoomOut.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) {
                startZoomOut();
                break;
            } else if (invertedColors.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) {
                startInvertedColors();
                break;
            } else if (talkBack.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) {
                enableTalkBack();
            } else if (disableTalkBack.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) {
                disableTalkBack();
            }
        }
    }
474432
public static <S extends Solution<?>> void sumOfObjectives(List<S> solutionsList) {
    for (S solution : solutionsList) {
      double sum = solution.getObjective(0);
      for (int i = 1; i < solution.getNumberOfObjectives(); i++) {
        sum += solution.getObjective(i);
      }
      setScalarizationValue(solution, sum);
    }
  }
961977
protected synchronized void compareReply(List<Long> processIds) {
        Object[] replyIds = replyProcessIds.toArray();
        for (Object replyId : replyIds) {
            if (processIds.contains((Long) replyId) == false) { // 判断reply id是否在当前processId列表中
                // 因为存在并发问题，如在执行Listener事件的同时，可能触发了process的创建，这时新建的processId会进入到reply队列中
                // 此时接受到的processIds变量为上一个版本的内容，所以会删除新建的process，导致整个通道被挂住
                if (CollectionUtils.isEmpty(processIds) == false) {
                    Long processId = processIds.get(0);
                    if (processId > (Long) replyId) { // 如果当前最小的processId都大于replyId, processId都是递增创建的
                        processTermined((Long) replyId); // 调用一下删除操作
                    }
                }
            }
        }
    }