Visualizing LINE's Android App Critical Path with AI
Key point
Using comment tags and AI, the critical path and bottlenecks in Android were quickly visualized.
Details
To reduce Chat Entry Time in LINE OA Chat, it was necessary to narrow down which function calls in the critical path were actually slow. However, since OA Chat shares a lot of logic with non-OA Chat, manually tracing every path was too inefficient.
At first, the call flow was organized as text, but thread information wasn't visible and it was hard to grasp the actual meaning. Manually creating diagrams with tools like Miro was convenient during meetings, but it was difficult to dig further into components or keep reflecting code changes.
As a solution, the approach chosen was to have AI directly visualize the code flow, while inserting comment tags so that not everything would be expanded indiscriminately.
@VISUALIZE_EXPAND: a signal to expand that particular function in more depth@FORK,@FORK_AGAIN,@FORK_END,@FORK_MERGE: mark parallel execution boundaries- External calls are treated as leaf nodes to prevent graph explosion
For example, with code like lifecycleScope.launch { ... collect(::initializeViews) }, it's hard to determine the actual thread through static analysis alone, but AI was able to infer the possibility of Main thread based on variable names and context. Also, for general-purpose calls like flowWithLifecycle(...).collect(), the AI was guided to skip them and only expand the actual points of interest marked with comments.
To further improve accuracy, AI was made to handle profiling logs as well. The start and end times of each task were logged, and that result was fed back into the AI to generate a graph including timing information, then suspicious parts were re-marked with comments and regenerated.
The output could be produced as PlantUML or SVG, aiming to balance internal wiki compatibility with readability. The author especially sees SVG as a potentially more flexible direction, but concludes that even now, there is great value in AI quickly handling the repetitive and tedious work of organizing paths on behalf of humans.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.