Skip to content

Commit f3b8268

Browse files
authored
Merge branch 'main' into feature/issue-170-channels
2 parents c73ce21 + 6d172b5 commit f3b8268

14 files changed

Lines changed: 2469 additions & 111 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: 'Daily Perf Improver Build Steps'
2+
description: 'Sets up the environment and builds FSharp.Control.AsyncSeq for performance testing and development'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Setup .NET SDK
7+
uses: actions/setup-dotnet@v3
8+
with:
9+
dotnet-version: '8.0.x'
10+
dotnet-quality: 'ga'
11+
12+
- name: Restore dependencies
13+
shell: bash
14+
run: dotnet restore
15+
16+
- name: Build solution in Release mode
17+
shell: bash
18+
run: dotnet build -c Release --no-restore
19+
20+
- name: Run tests to verify build
21+
shell: bash
22+
run: dotnet test -c Release --no-build --logger trx --results-directory TestResults/
23+
24+
- name: Run performance baseline test
25+
shell: bash
26+
run: dotnet fsi tests/FSharp.Control.AsyncSeq.Tests/AsyncSeqPerf.fsx
27+
28+
- name: Setup tools for performance analysis
29+
shell: bash
30+
run: |
31+
# Install dotnet tools for performance analysis (if needed)
32+
echo "Build environment ready for performance testing"
33+
echo "Available tools:"
34+
echo "- dotnet build/test for regular builds"
35+
echo "- dotnet fsi for F# Interactive and performance scripts"
36+
echo "- Release builds available in src/FSharp.Control.AsyncSeq/bin/Release/"
37+
echo "- Test results in TestResults/"
38+
39+
- name: Display environment info
40+
shell: bash
41+
run: |
42+
echo "=== Environment Information ==="
43+
echo "Operating System: $(uname -a)"
44+
echo ".NET Version: $(dotnet --version)"
45+
echo "F# Compiler: $(dotnet fsc --version 2>/dev/null || echo 'F# Compiler available via dotnet')"
46+
echo "Working Directory: $(pwd)"
47+
echo "Available cores: $(nproc)"
48+
echo "Memory: $(free -h | head -n 2)"
49+
echo "=== Build Artifacts ==="
50+
find src/FSharp.Control.AsyncSeq/bin/Release -type f -name "*.dll" 2>/dev/null || echo "No build artifacts found"
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: 'Daily Test Coverage Improver - Coverage Steps'
2+
description: 'Builds project, runs tests, and generates coverage reports'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Setup .NET
7+
uses: actions/setup-dotnet@v4
8+
with:
9+
dotnet-version: '8.0.x'
10+
11+
- name: Restore dependencies
12+
shell: bash
13+
run: dotnet restore
14+
15+
- name: Build project
16+
shell: bash
17+
run: dotnet build --no-restore
18+
19+
- name: Add coverlet collector
20+
shell: bash
21+
run: |
22+
dotnet add tests/FSharp.Control.AsyncSeq.Tests/FSharp.Control.AsyncSeq.Tests.fsproj package coverlet.collector --version 6.0.0 --no-restore || true
23+
24+
- name: Run tests with coverage
25+
shell: bash
26+
run: |
27+
dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage --logger "console;verbosity=detailed"
28+
29+
- name: Install ReportGenerator
30+
shell: bash
31+
run: dotnet tool install -g dotnet-reportgenerator-globaltool || dotnet tool update -g dotnet-reportgenerator-globaltool
32+
33+
- name: Generate coverage report
34+
shell: bash
35+
run: |
36+
reportgenerator -reports:"coverage/**/coverage.cobertura.xml" -targetdir:"coverage/report" -reporttypes:"Html;Badges;Cobertura;JsonSummary"
37+
38+
- name: Display coverage summary
39+
shell: bash
40+
run: |
41+
echo "=== Coverage Summary ==="
42+
if [ -f "coverage/report/Summary.json" ]; then
43+
cat coverage/report/Summary.json | grep -E '"coverage":|"covered":|"uncovered":|"coverable":'
44+
else
45+
echo "Coverage summary not found"
46+
find coverage -name "*.xml" -o -name "*.json" | head -5
47+
fi
48+
49+
- name: Upload coverage report
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: coverage-report
53+
path: coverage/report/
54+
retention-days: 30
55+
56+
- name: Upload raw coverage data
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: coverage-data
60+
path: coverage/
61+
retention-days: 7

.github/workflows/daily-perf-improver.lock.yml

Lines changed: 719 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
---
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
# Run daily at 2am UTC, all days except Saturday and Sunday
6+
- cron: "0 2 * * 1-5"
7+
stop-after: +48h # workflow will no longer trigger after 48 hours
8+
9+
timeout_minutes: 30
10+
11+
permissions:
12+
contents: write # needed to create branches, files, and pull requests in this repo without a fork
13+
issues: write # needed to create report issue
14+
pull-requests: write # needed to create results pull request
15+
actions: read
16+
checks: read
17+
statuses: read
18+
19+
tools:
20+
github:
21+
allowed:
22+
[
23+
create_issue,
24+
update_issue,
25+
add_issue_comment,
26+
create_or_update_file,
27+
create_branch,
28+
delete_file,
29+
push_files,
30+
update_pull_request,
31+
]
32+
claude:
33+
allowed:
34+
Edit:
35+
MultiEdit:
36+
Write:
37+
NotebookEdit:
38+
WebFetch:
39+
WebSearch:
40+
# Configure bash build commands here, or in .github/workflows/agentics/daily-perf-improver.config.md
41+
#Bash: [":*"]
42+
Bash: ["gh pr create:*", "git commit:*", "git push:*", "git checkout:*", "git branch:*", "git add:*", "gh auth status", "gh repo view", "gh issue comment:*"]
43+
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v3
47+
48+
- name: Check if action.yml exists
49+
id: check_build_steps_file
50+
run: |
51+
if [ -f ".github/actions/daily-perf-improver/build-steps/action.yml" ]; then
52+
echo "exists=true" >> $GITHUB_OUTPUT
53+
else
54+
echo "exists=false" >> $GITHUB_OUTPUT
55+
fi
56+
shell: bash
57+
- name: Build the project ready for performance testing
58+
if: steps.check_build_steps_file.outputs.exists == 'true'
59+
uses: ./.github/actions/daily-perf-improver/build-steps
60+
id: build-steps
61+
62+
---
63+
64+
# Daily Perf Improver
65+
66+
## Job Description
67+
68+
Your name is ${{ github.workflow }}. Your job is to act as an agentic coder for the GitHub repository `${{ github.repository }}`. You're really good at all kinds of tasks. You're excellent at everything.
69+
70+
1. Performance research (if not done before).
71+
72+
1a. Check if an open issue with title "${{ github.workflow }}: Research and Plan" exists. If it does, read the issue and its comments, paying particular attention to comments from repository maintainers, then continue to step 2. If not, follow the steps below to create it:
73+
74+
1b. Do some deep research into performance matters in this repo.
75+
- How is performance testing is done in the repo?
76+
- How to do micro benchmarks in the repo?
77+
- What are typical workloads for the software in this repo?
78+
- Where are performance bottlenecks?
79+
- Is perf I/O, CPU or Storage bound?
80+
- What do the repo maintainers care about most w.r.t. perf.?
81+
- What are realistic goals for Round 1, 2, 3 of perf improvement?
82+
- What actual commands are used to build, test, profile and micro-benchmark the code in this repo?
83+
- What concrete steps are needed to set up the environment for performance testing and micro-benchmarking?
84+
- What existing documentation is there about performance in this repo?
85+
- What exact steps need to be followed to benchmark and profile a typical part of the code in this repo?
86+
87+
Research:
88+
- Functions or methods that are slow
89+
- Algorithms that can be optimized
90+
- Data structures that can be made more efficient
91+
- Code that can be refactored for better performance
92+
- Important routines that dominate performance
93+
- Code that can be vectorized or other standard techniques to improve performance
94+
- Any other areas that you identify as potential performance bottlenecks
95+
- CPU, memory, I/O or other bottlenecks
96+
97+
Consider perf engineering fundamentals:
98+
- You want to get to a zone where the engineers can run commands to get numbers towards some performance goal - with commands running reliably within 1min or so - and it can "see" the code paths associated with that. If you can achieve that, your engineers will be very good at finding low-hanging fruit to work towards the performance goals.
99+
100+
1b. Use this research to write an issue with title "${{ github.workflow }}: Research and Plan", then exit this entire workflow.
101+
102+
2. Generate build steps configuration (if not done before).
103+
104+
2a. Check if `.github/actions/daily-perf-improver/build-steps/action.yml` exists in this repo. Note this path is relative to the current directory (the root of the repo). If this file exists, it will have been run already as part of the GitHub Action you are executing in, so read the file to understand what has already been run and continue to step 3. Otherwise continue to step 2b.
105+
106+
2b. Check if an open pull request with title "${{ github.workflow }}: Updates to complete configuration" exists in this repo. If it does, add a comment to the pull request saying configuration needs to be completed, then exit the workflow. Otherwise continue to step 2c.
107+
108+
2c. Have a careful think about the CI commands needed to build the project and set up the environment for individual performance development work, assuming one set of build assumptions and one architecture (the one running). Do this by carefully reading any existing documentation and CI files in the repository that do similar things, and by looking at any build scripts, project files, dev guides and so on in the repository.
109+
110+
2d. Create the file `.github/actions/daily-perf-improver/build-steps/action.yml` as a GitHub Action containing these steps, ensuring that the action.yml file is valid and carefully cross-checking with other CI files and devcontainer configurations in the repo to ensure accuracy and correctness.
111+
112+
2e. Make a pull request for the addition of this file, with title "${{ github.workflow }}: Updates to complete configuration". Explain that adding these files to the repo will make this workflow more reliable and effective. Encourage the maintainer to review the files carefully to ensure they are appropriate for the project. Exit the entire workflow.
113+
114+
3. Performance goal selection: build an understanding of what to work on and select a part of the performance plan to pursue.
115+
116+
3a. You can now assume the repository is in a state where the steps in `.github/actions/daily-perf-improver/build-steps/action.yml` have been run and is ready for performance testing, running micro-benchmarks etc. Read this file to understand what has been done.
117+
118+
3b. Read the plan in the issue mentioned earlier, along with comments.
119+
120+
3c. Check any existing open pull requests that are related to performance improvements especially any opened by you starting with title "${{ github.workflow }}".
121+
122+
3d. If you think the plan is inadequate, and needs a refresh, update the planning issue by rewriting the actual body of the issue, ensuring you take into account any comments from maintainers. Add one single comment to the issue saying nothing but the plan has been updated with a one sentence explanation about why. Do not add comments to the issue, just update the body. Then continue to step 3e.
123+
124+
3e. Select a performance improvement goal to pursue from the plan. Ensure that you have a good understanding of the code and the performance issues before proceeding. Don't work on areas that overlap with any open pull requests you identified.
125+
126+
4. Work towards your selected goal.. For the performance improvement goal you selected, do the following:
127+
128+
4a. Create a new branch.
129+
130+
4b. Make the changes to work towards the performance improvement goal you selected. This may involve:
131+
- Refactoring code
132+
- Optimizing algorithms
133+
- Changing data structures
134+
- Adding caching
135+
- Parallelizing code
136+
- Improving memory access patterns
137+
- Using more efficient libraries or frameworks
138+
- Reducing I/O operations
139+
- Reducing network calls
140+
- Improving concurrency
141+
- Using profiling tools to identify bottlenecks
142+
- Improving engineering practices
143+
- Other techniques to improve performance
144+
145+
4c. Ensure the code still works as expected and that any existing relevant tests pass.
146+
147+
4d. After making the changes, if appropriate measure their impact on performance.
148+
149+
- Get actual performance numbers
150+
- If you can't successfully measure the performance impact, then continue but make a note of what you tried.
151+
- Run individual benchmarks and comparing results.
152+
- Benchmarking should be done in a way that is reliable and reproducible, though beware that because you're running in a virtualised environment wall-clock-time measurements may not be 100% accurate.
153+
- If the changes do not improve performance, then iterate or consider reverting them or trying a different approach.
154+
155+
4e. Apply any automatic code formatting used in the repo
156+
157+
4f. Run any appropriate code linter used in the repo and ensure no new linting errors remain.
158+
159+
5. If you succeeded in writing useful code changes that improve performance, create a draft pull request with your changes.
160+
161+
- Use Bash `git add ...`, `git commit ...`, `git push ...` etc. to push the changes to your branch.
162+
163+
- Use Bash `gh pr create --repo ${{ github.repository }} ...` to create a pull request with the changes.
164+
165+
5a. Include a description of the improvements, details of the benchmark runs that show improvement and by how much, made and any relevant context.
166+
167+
5b. Do NOT include performance reports or any tool-generated files in the pull request. Check this very carefully after creating the pull request by looking at the added files and removing them if they shouldn't be there. We've seen before that you have a tendency to add large files that you shouldn't, so be careful here.
168+
169+
5c. In the description, explain:
170+
171+
- the performance improvement goal you decided to pursue and why
172+
- the approach you took to your work, including your todo list
173+
- the actions you took
174+
- the build, test, benchmarking and other steps you used
175+
- the performance measurements you made
176+
- the measured improvements achieved
177+
- the problems you found
178+
- the changes made
179+
- what did and didn't work
180+
- possible other areas for future improvement
181+
- include links to any issues you created or commented on, and any pull requests you created.
182+
- list any bash commands you used, any web searches you performed, and any web pages you visited that were relevant to your work. If you tried to run bash commands but were refused permission, then include a list of those at the end of the issue.
183+
184+
5d. After creation, check the pull request to ensure it is correct, includes all expected files, and doesn't include any unwanted files or changes. Make any necessary corrections by pushing further commits to the branch.
185+
186+
5e. Add a very brief comment to the issue from step 1a if it exists, saying you have worked on the particular performance goal and linking to the pull request you created.
187+
188+
5f. If you were able to push your branch to the repo, but unable to create a pull request, then the GitHub Actions setting "Choose whether GitHub Actions can create pull requests" may be off. Create an issue describing the problem with a link to https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#preventing-github-actions-from-creating-or-approving-pull-requests and exit the entire workflow.
189+
190+
6. If you didn't succeed in improving performance, create an issue with title starting with "${{ github.workflow }}", summarizing similar information to above.
191+
192+
7. If you encounter any unexpected failures or have questions, add comments to the pull request or issue to seek clarification or assistance.
193+
194+
8. If you are unable to improve performance in a particular area, add a comment explaining why and what you tried. If you have any relevant links or resources, include those as well.
195+
196+
9. Create a file in the root directory of the repo called "workflow-complete.txt" with the text "Workflow completed successfully".
197+
198+
@include agentics/shared/no-push-to-main.md
199+
200+
@include agentics/shared/tool-refused.md
201+
202+
@include agentics/shared/include-link.md
203+
204+
@include agentics/shared/job-summary.md
205+
206+
@include agentics/shared/xpia.md
207+
208+
@include agentics/shared/gh-extra-tools.md
209+
210+
<!-- You can whitelist tools in .github/workflows/build-tools.md file -->
211+
@include? agentics/build-tools.md
212+
213+
<!-- You can customize prompting and tools in .github/workflows/agentics/daily-perf-improver.config -->
214+
@include? agentics/daily-perf-improver.config.md

RELEASE_NOTES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
### 3.3.1
2+
* Quick summary of changes:
3+
- Performance improvements: optimized `iterAsync` and `iteriAsync`; optimized `collect`, `mapAsync` and `unfoldAsync`; fixed append memory leak (Issue #35).
4+
- Added `mapAsyncUnorderedParallel` for improved parallel performance.
5+
- Set up BenchmarkDotNet for systematic benchmarking; performance benchmarks show measurable improvements (addresses Round 1 & 2 of #190).
6+
- Build/CI updates: configuration and build-step updates.
7+
18
### 3.2.1
29
* Release latest
310

0 commit comments

Comments
 (0)