# Adding the V8 CPU Profiler to v8go

DevFeed: [Adding the V8 CPU Profiler to v8go](<https://devfeed.tech/articles/adding-the-v8-cpu-profiler-to-v8go-1289.md>)

Original publisher: [Read original article](<https://shopify.engineering/adding-v8-cpu-profiler-v8go>)

Author: Genevieve LEsperance

Published: 2022-03-04T15:10:36Z

Content type: article

Language: en

Sources: [Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering.md>), [Shopify Engineering - Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering-shopify-engineering.md>)

Topics: [V8](<https://devfeed.tech/topics/v8.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [benchmarking](<https://devfeed.tech/topics/benchmarking.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Library](<https://devfeed.tech/topics/library.md>), [cpu](<https://devfeed.tech/topics/cpu.md>), [WebAssembly](<https://devfeed.tech/topics/web-assembly.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>)

Tags: [benchmarking](<https://devfeed.tech/tags/benchmarking.md>), [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [garbage-collection](<https://devfeed.tech/tags/garbage-collection.md>), [go](<https://devfeed.tech/tags/go.md>), [google](<https://devfeed.tech/tags/google.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [performance](<https://devfeed.tech/tags/performance.md>), [virtual-machines](<https://devfeed.tech/tags/virtual-machines.md>)

## AI overview

This article describes adding V8 CPU Profiler support to v8go, a Go and C++ library that executes JavaScript through V8 isolates. It explains the profiler's API, sampling-based CPU profiling, returned call trees, and the role of benchmarking in evaluating implementation performance.

## Source excerpt

V8 is Google's open source high-performance JavaScript and WebAssembly engine written in C++. v8go is a library written in Go and C++ allowing users to execute JavaScript from Go using V8 isolates. Using Cgo bindings allows us to run JavaScript in Go at native performance. The v8go library, developed by Roger Chapman, aims to provide an idiomatic way for Go developers to interface with V8. As it turns out, this can be tricky.