Skip to content

Add FPS (Formal Power Series) benchmark workload - #34

Merged
shakayami merged 1 commit into
masterfrom
claude/fps-performance-tests-sm35xl
Jul 16, 2026
Merged

Add FPS (Formal Power Series) benchmark workload#34
shakayami merged 1 commit into
masterfrom
claude/fps-performance-tests-sm35xl

Conversation

@shakayami

Copy link
Copy Markdown
Owner

Summary

This PR adds a new benchmark workload for Formal Power Series (FPS) operations to the benchmarks suite.

Key Changes

  • Import the fps module at the top of the workloads file
  • Add build_fps_workload() function that generates a random sequence of n=8,192 elements modulo 998244353
  • Add run_fps() function that performs FPS operations: exponential, logarithm, and resize operations
  • Register the new FPS benchmark in the BENCHMARKS list

Implementation Details

The FPS workload:

  • Generates a sequence of 8,192 random integers (with the first element fixed at 0)
  • Tests three key FPS operations: exp() (exponential), log() (logarithm), and resize() (resizing to original length)
  • Uses the same modulo constant (998244353) as other benchmarks for consistency

https://claude.ai/code/session_011dKfP4nUzhqoGypWQNJxta

Exercises exp/log (which internally use diff, integral, inv, and
multiplication) on an 8192-term series, picked up automatically by
both the pytest-benchmark time suite and the tracemalloc memory suite
since they iterate workloads.BENCHMARKS.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011dKfP4nUzhqoGypWQNJxta
@github-actions

Copy link
Copy Markdown

📊 Performance Benchmark Results

⏱️ Execution time (mean, lower is better)

Benchmark Base PR Delta
convolution 959.67ms 884.09ms -7.9% ✅
dsu 105.99ms 106.49ms +0.5%
fps n/a 570.37ms n/a
lazysegtree 1.631s 1.665s +2.0%
maxflow 11.24ms 12.49ms +11.1% ⚠️
mincostflow 5.13ms 4.67ms -9.0% ✅
scc 146.60ms 144.72ms -1.3% ✅
segtree 245.07ms 246.32ms +0.5%

💾 Peak memory (lower is better)

Benchmark Base PR Delta
convolution 16.1MiB 16.1MiB +0.0%
dsu 849.2KiB 849.2KiB +0.0%
fps n/a 3.9MiB n/a
lazysegtree 5.0MiB 5.0MiB +0.0%
maxflow 2.3MiB 2.3MiB +0.0%
mincostflow 662.2KiB 662.2KiB +0.0%
scc 13.8MiB 13.8MiB +0.0%
segtree 1.5MiB 1.5MiB +0.0%

Base = target branch, PR = this branch. Negative delta = improvement. ✅ improvement ≥ 1%, ⚠️ regression > 5%. "n/a" base entries mean the target branch has no benchmark suite yet.

@shakayami
shakayami merged commit 83085d6 into master Jul 16, 2026
20 checks passed
@shakayami
shakayami deleted the claude/fps-performance-tests-sm35xl branch July 16, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants