Add parser performance benchmarks with CI comparison workflow#102
Draft
Add parser performance benchmarks with CI comparison workflow#102
Conversation
- Added ordo-one/package-benchmark dependency to Package.swift - Created SwiftBeanCountParserBenchmarks executable target - Implemented two parser benchmarks: file parsing and string parsing - Added Big.beancount test resource for benchmarks - Updated .gitignore to exclude benchmark artifacts Co-authored-by: Nef10 <4551135+Nef10@users.noreply.github.com>
- Created benchmarks.yml workflow to run on PRs - Workflow compares base vs PR branch performance - Configured 10% threshold for performance regression detection - Added jemalloc installation step for Linux - Fixed SwiftLint violations in benchmark code - Benchmarks now lint cleanly Co-authored-by: Nef10 <4551135+Nef10@users.noreply.github.com>
- Removed unnecessary availability check for String(contentsOf:encoding:) - Use explicit UTF-8 encoding consistently - Simplified code by removing conditional logic Co-authored-by: Nef10 <4551135+Nef10@users.noreply.github.com>
- Added comment to clarify file loading happens before measurement - This ensures only parsing performance is benchmarked, not I/O Co-authored-by: Nef10 <4551135+Nef10@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add parser performance tests for benchmarking
Add parser performance benchmarks with CI comparison workflow
Jan 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restores performance testing for the parser using the ordo-one/package-benchmark framework, previously removed in #100.
Changes
Benchmark implementation: Two benchmarks using the existing 6.5k line
Big.beancounttest fileParse Big File: Measures file I/O + parsing viaParser.parse(contentOf:)Parse Big File (String): Measures pure parsing viaParser.parse(string:)with pre-loaded contentCI workflow: Runs on PRs, benchmarks base vs head in same runner, posts markdown comparison to PR, fails on >10% regression
Dependencies: Added
package-benchmark1.29.7+, includes jemalloc for memory profilingWorkflow follows the official CI comparison guide for baseline comparison in the same runner environment.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com/usr/lib/apt/methods/https /usr/lib/apt/methods/https -parse-as-library -incremental -c @/home/REDACTED/work/SwiftBeanCount/SwiftBeanCount/.build/x86_64-REDACTED-linux-gnu/debug/SwiftBeanCountParser.build/sources -I /home/REDACTED/work/SwiftBeanCount/SwiftBeanCount/.build/x86_64-REDACTED-linux-gnu/debug/Modules rk/Sources/Benchmark/ARCStats/ARCStats.swift x86_64-REDACTED-linux-gnu rk/Sources/Benchmark/ARCStats/ARCStatsProducer.swift -enable-batch-mode rk/Sources/Benchmark/Benchmark+ConvenienceInitializers.swift -e rk/Sources/Benchmark/Benchmark.swift git rk/Sources/Benchmark/BenchmarkClock.swift l rk/Sources/Benchmark/BenchmarkExecutor+Extensions.swift 917bb95775729d4f-emit-module rk/Sources/Benchmark/BenchmarkExecutor.swift(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.