# Otimização de desempenho (Go) > Profiling, benchmarking, CPU profiling, memory profiling, análise de gargalos, otimizações - 22 perguntas de entrevista - Senior - [Perguntas de entrevista: Go](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista.md) ## 1. O que é a ferramenta pprof em Go? **Resposta** pprof é a ferramenta de profiling integrada ao Go que permite analisar o desempenho de CPU, memória, goroutines e outras métricas. Ela gera perfis em formato binário analisáveis com go tool pprof. Essa ferramenta é essencial para identificar os gargalos de desempenho e otimizar as aplicações Go em produção. ## 2. Como habilitar o profiling de CPU em uma aplicação Go? **Resposta** O profiling de CPU é habilitado com pprof.StartCPUProfile(file) e interrompido com pprof.StopCPUProfile(). Essa abordagem captura o uso de CPU durante a execução do programa. Para aplicações web, usar o pacote net/http/pprof expõe automaticamente os endpoints de profiling. ## 3. Qual é a diferença entre o profiling de CPU e o profiling de memória? **Resposta** O profiling de CPU mede o tempo gasto em cada função para identificar os gargalos de execução, enquanto o profiling de memória mede as alocações de memória para detectar vazamentos e uso excessivo. O profiling de CPU usa amostragem a cada 10ms por padrão, o profiling de memória captura todas as alocações ou uma amostra conforme a configuração. ## Mais 19 perguntas disponiveis - Como criar um benchmark em Go com o pacote testing? - O que significa o resultado '1000 ns/op' em um benchmark Go? Cadastre-se gratis: https://sharpskill.dev/pt/login ## Outros temas de entrevista Go - [Fundamentos de Go](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/go-basics.md): 25 perguntas, Junior - [Estruturas de dados em Go](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/go-data-structures.md): 20 perguntas, Junior - [Interfaces em Go](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/go-interfaces.md): 18 perguntas, Junior - [Tratamento de erros](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/error-handling.md): 20 perguntas, Junior - [Goroutines básicas](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/goroutines-basics.md): 20 perguntas, Junior - [Channels](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/channels.md): 22 perguntas, Junior - [Go Modules](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/go-modules.md): 18 perguntas, Mid-Level - [Servidor HTTP](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/http-server.md): 24 perguntas, Mid-Level - [Cliente HTTP](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/http-client.md): 18 perguntas, Mid-Level - [Codificação JSON](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/json-encoding.md): 20 perguntas, Mid-Level - [Database/SQL](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/database-sql.md): 22 perguntas, Mid-Level - [Pacote context](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/context-package.md): 20 perguntas, Mid-Level - [Testing](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/testing.md): 22 perguntas, Mid-Level - [Padrões de concorrência](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/concurrency-patterns.md): 24 perguntas, Mid-Level - [Primitivas de sincronização](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/sync-primitives.md): 22 perguntas, Mid-Level - [Frameworks web Go](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/go-web-frameworks.md): 20 perguntas, Mid-Level - [Design de API REST](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/rest-api-design.md): 20 perguntas, Mid-Level - [gRPC](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/grpc.md): 22 perguntas, Mid-Level - [Reflection](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/reflection.md): 20 perguntas, Senior - [Gerenciamento de memória](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/memory-management.md): 24 perguntas, Senior - [Generics](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/generics.md): 20 perguntas, Senior - [Go Design Patterns](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/design-patterns.md): 24 perguntas, Senior - [Microservices](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/microservices.md): 24 perguntas, Senior - [Segurança e autenticação](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/security-authentication.md): 24 perguntas, Senior - [Docker & Containerization](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/docker-containerization.md): 20 perguntas, Senior - [Kubernetes Basics](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/kubernetes-basics.md): 22 perguntas, Senior - [Go Avançado](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/advanced-go.md): 20 perguntas, Senior - [Desenvolvimento de CLI](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/cli-development.md): 20 perguntas, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/performance-optimization