public ProfileStackTree buildAnalyzeResult() {
        // all nodes add to single-level list (such as flat), work for parallel calculating
        LinkedList<Pair<ProfileStackElement, ProfileStackNode>> nodeMapping = new LinkedList<>();
        int idGenerator = 1;

        ProfileStackElement root = buildElement(idGenerator++);
        nodeMapping.add(new Pair<>(root, this));

        // same with combine logic
        LinkedList<Pair<ProfileStackElement, ProfileStackNode>> stack = new LinkedList<>();
        stack.add(new Pair<>(root, this));
        while (!stack.isEmpty()) {
            Pair<ProfileStackElement, ProfileStackNode> mergingPair = stack.pop();
            ProfileStackElement respElement = mergingPair.key;

            // generate children node and add to stack and all node mapping
            for (ProfileStackNode children : mergingPair.value.children) {
                ProfileStackElement element = children.buildElement(idGenerator++);
                element.setParentId(respElement.getId());

                Pair<ProfileStackElement, ProfileStackNode> pair = new Pair<>(element, children);
                stack.add(pair);
                nodeMapping.add(pair);
            }
        }

        // calculate durations
        nodeMapping.parallelStream().forEach(t -> t.value.calculateDuration(t.key));
        nodeMapping.parallelStream().forEach(t -> t.value.calculateDurationExcludeChild(t.key));

        ProfileStackTree tree = new ProfileStackTree();
        nodeMapping.forEach(n -> tree.getElements().add(n.key));

        return tree;
    }
build GraphQL result, calculate duration and count data using parallels
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/profiling/trace/analyze/ProfileStackNode.java