
3/4/2022
What this post added
This post details the integration of the V8 CPU Profiler into the v8go library. It explores two primary implementation strategies: lazy loading, where Cgo calls are made for each profile property, and eager loading, where the entire profile graph is built in C++ and passed as a single pointer to Go. Benchmarks comparing these approaches for small and large JavaScript execution trees are presented, highlighting the performance implications of Cgo overhead and the benefits of eager loading for larger profiles. The post also discusses the design considerations for an API that is easy to reason about, extendable, aligned with the V8 API, and performant.