Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion cli/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ func printConfiguration(benchArgs *args.BenchArgs, functionFilterPerBench map[st
func runBenchAndGetProfiles(benchArgs *args.BenchArgs, benchmarkConfigs map[string]config.FunctionFilter) error {
slog.Info("Starting benchmark pipeline...")

var functionFilter config.FunctionFilter
globalFilter, hasGlobalFilter := benchmarkConfigs[shared.GlobalSign]
if hasGlobalFilter {
functionFilter = globalFilter
}

for _, benchmarkName := range benchArgs.Benchmarks {
slog.Info("Running benchmark", "Benchmark", benchmarkName)
if err := benchmark.RunBenchmark(benchmarkName, benchArgs.Profiles, benchArgs.Count, benchArgs.Tag); err != nil {
Expand All @@ -48,11 +54,16 @@ func runBenchAndGetProfiles(benchArgs *args.BenchArgs, benchmarkConfigs map[stri
}

slog.Info("Analyzing profile functions", "Benchmark", benchmarkName)

if !hasGlobalFilter {
functionFilter = benchmarkConfigs[benchmarkName]
}

args := &args.CollectionArgs{
Tag: benchArgs.Tag,
Profiles: benchArgs.Profiles,
BenchmarkName: benchmarkName,
BenchmarkConfig: benchmarkConfigs[benchmarkName],
BenchmarkConfig: functionFilter,
}

if err := benchmark.CollectProfileFunctions(args); err != nil {
Expand Down
18 changes: 8 additions & 10 deletions docs/codebase_design.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Prof Tool Architecture Documentation

## Overview
# Codebase

Prof is a Go benchmark profiling tool designed to automate performance analysis and comparison. It wraps Go's built-in benchmarking and pprof tools to provide comprehensive profiling data collection, organization, and performance regression detection.

**🔗 [Interactive Architecture Graph](https://claude.ai/public/artifacts/3582cc33-8d87-447a-8cac-7e94c2b67f5b)** - Explore the component relationships visually
**[Interactive Architecture Graph](https://claude.ai/public/artifacts/3582cc33-8d87-447a-8cac-7e94c2b67f5b)** - Explore the component relationships visually

## Core Functionality

Expand All @@ -16,7 +14,7 @@ Prof provides three main capabilities:

## Package Architecture

### 📁 Package Structure
### Package Structure

```
prof/
Expand All @@ -37,7 +35,7 @@ prof/

## Package Details

### 🚀 `cmd/prof` - Entry Point
### `cmd/prof` - Entry Point

**Location**: `cmd/prof/main.go`

Expand All @@ -49,7 +47,7 @@ The application entry point that initializes and starts the CLI. This is the min
- Error handling and exit codes
- CLI delegation

### 🎮 `cli` - Command Interface
### `cli` - Command Interface

**Location**: `cli/`

Expand All @@ -75,7 +73,7 @@ Handles all user interaction through a Cobra-based command-line interface. Acts
- Workflow orchestration
- Output formatting and reporting

### `engine` - Core Business Logic
### `engine` - Core Business Logic

The engine package contains all the core operational components of Prof.

Expand Down Expand Up @@ -126,7 +124,7 @@ The engine package contains all the core operational components of Prof.
- `CheckPerformanceDifferencesManual()` - Manual profile comparison
- `DetectChange()` - Analyzes performance changes between runs

### 🔍 `parser` - Profile Data Processing
### `parser` - Profile Data Processing

**Location**: `parser/`

Expand All @@ -145,7 +143,7 @@ Handles parsing and processing of pprof text output into structured data that ca
- `TurnLinesIntoObjects()` - Converts profile lines to structured data
- `ShouldKeepLine()` - Applies filtering rules to profile lines

### 🔒 `internal` - Protected Utilities
### `internal` - Protected Utilities

The internal package contains utilities that are protected from external imports by Go's internal package convention.

Expand Down
4 changes: 1 addition & 3 deletions engine/collector/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import (
"github.com/AlexsanderHamir/prof/internal/shared"
)

const globalSign = "*"

// RunCollector handles data organization without wrapping go test.
func RunCollector(files []string, tag string) error {
if err := ensureDirExists(shared.MainDirOutput); err != nil {
Expand All @@ -31,7 +29,7 @@ func RunCollector(files []string, tag string) error {
}

var functionFilter config.FunctionFilter
globalFilter, hasGlobalFilter := cfg.FunctionFilter[globalSign]
globalFilter, hasGlobalFilter := cfg.FunctionFilter[shared.GlobalSign]
if hasGlobalFilter {
functionFilter = globalFilter
}
Expand Down
1 change: 1 addition & 0 deletions internal/shared/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const (
FunctionsDirSuffix = "_functions"
TextExtension = "txt"
ConfigFilename = "config_template.json"
GlobalSign = "*"
)

func GetScanner(filePath string) (*bufio.Scanner, *os.File, error) {
Expand Down
20 changes: 0 additions & 20 deletions prof_web_doc/.gitignore

This file was deleted.

41 changes: 0 additions & 41 deletions prof_web_doc/README.md

This file was deleted.

12 changes: 0 additions & 12 deletions prof_web_doc/blog/2019-05-28-first-blog-post.md

This file was deleted.

44 changes: 0 additions & 44 deletions prof_web_doc/blog/2019-05-29-long-blog-post.md

This file was deleted.

24 changes: 0 additions & 24 deletions prof_web_doc/blog/2021-08-01-mdx-blog-post.mdx

This file was deleted.

Binary file not shown.
29 changes: 0 additions & 29 deletions prof_web_doc/blog/2021-08-26-welcome/index.md

This file was deleted.

25 changes: 0 additions & 25 deletions prof_web_doc/blog/authors.yml

This file was deleted.

19 changes: 0 additions & 19 deletions prof_web_doc/blog/tags.yml

This file was deleted.

Loading
Loading