ondrajz / go-callvis

Visualize call graph of a Go program using Graphviz
https://ofabry.github.io/go-callvis
MIT License
5.82k stars 402 forks source link

Performance #91

Closed dpanic closed 3 years ago

dpanic commented 3 years ago

Hi,

Is it possible to speedup go-callvis? Do we know what are the botlenecks of project? Is it go-callvis itself or graphiz?

dpanic commented 3 years ago

I actually managed to speedup go-callvis where the performance issue was.

This was problematic part of code, in my fork I removed some of those checks as I don't need them.

// include path prefixes
if len(includePaths) > 0 &&
    (inIncludes(caller) || inIncludes(callee)) {
    logf("include: %s -> %s", caller, callee)
    include = true
}

if !include {
    // limit path prefixes
    if len(limitPaths) > 0 &&
        (!inLimits(caller) || !inLimits(callee)) {
        logf("NOT in limit: %s -> %s", caller, callee)
        return nil
    }

    // ignore path prefixes
    if len(ignorePaths) > 0 &&
        (inIgnores(caller) || inIgnores(callee)) {
        logf("IS ignored: %s -> %s", caller, callee)
        return nil
    }
}
dpanic commented 3 years ago

Marking it resolved