Add C benchmark infrastructure to compare current branch vs v0.8.0#124
Closed
Add C benchmark infrastructure to compare current branch vs v0.8.0#124
Conversation
Co-authored-by: darnstrom <55484604+darnstrom@users.noreply.github.com> Agent-Logs-Url: https://github.com/darnstrom/daqp/sessions/d06a8234-44af-4138-97cf-b6e9e63f9db8
Copilot
AI
changed the title
[WIP] Improve computation efficiency in core C files
Optimize core computational routines in daqp.c, auxiliary.c, factorization.c, utils.c
Mar 20, 2026
…solver files Co-authored-by: darnstrom <55484604+darnstrom@users.noreply.github.com> Agent-Logs-Url: https://github.com/darnstrom/daqp/sessions/69bcb6ff-355d-4a57-9e94-b9a651e0e715
Copilot
AI
changed the title
Optimize core computational routines in daqp.c, auxiliary.c, factorization.c, utils.c
Optimize core solver routines while preserving ANSI C compatibility
Mar 20, 2026
…ranchless LDL copy, scalar hoisting Co-authored-by: darnstrom <55484604+darnstrom@users.noreply.github.com> Agent-Logs-Url: https://github.com/darnstrom/daqp/sessions/e10a68ed-b14f-434b-84b8-757f0d99a068
Copilot
AI
changed the title
Optimize core solver routines while preserving ANSI C compatibility
Optimize core solver routines: remove non-ANSI-C extensions, improve cache access patterns
Mar 20, 2026
Co-authored-by: darnstrom <55484604+darnstrom@users.noreply.github.com> Agent-Logs-Url: https://github.com/darnstrom/daqp/sessions/7c31f878-dc03-4642-beba-62cc34c53a82
Copilot stopped work on behalf of
darnstrom due to an error
March 20, 2026 18:09
…ew dependencies) Co-authored-by: darnstrom <55484604+darnstrom@users.noreply.github.com> Agent-Logs-Url: https://github.com/darnstrom/daqp/sessions/117a647f-ae4c-457d-a2db-67a4031dd13b
Copilot
AI
changed the title
Optimize core solver routines: remove non-ANSI-C extensions, improve cache access patterns
Performance optimizations for core DAQP solver routines (ANSI C, no new dependencies)
Mar 20, 2026
Co-authored-by: darnstrom <55484604+darnstrom@users.noreply.github.com> Agent-Logs-Url: https://github.com/darnstrom/daqp/sessions/e083c538-91c8-495c-bc91-fc1f824f51b0
Copilot
AI
changed the title
Performance optimizations for core DAQP solver routines (ANSI C, no new dependencies)
Add C benchmark infrastructure to compare current branch vs v0.8.0
Mar 20, 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.
Adds a self-contained C benchmark to quantify solve-time changes on this branch relative to v0.8.0, and applies the micro-optimizations that came out of that analysis.
Benchmark (
benchmark/)bench_qp.c— standalone C program, no Julia/MATLAB required. Generates dense random QPs at n=10–80, runs 3000 solves per size, takes best-of-7 passes to suppress OS jitter. Links against anylibdaqpstat.a.README.md— build instructions and two-version comparison workflow.# Build and compare gcc -O3 -fassociative-math -fno-signed-zeros -fno-trapping-math \ -I include -I codegen benchmark/bench_qp.c build/libdaqpstat.a -lm -o bench ./benchMeasured results (identical flags:
-O3 -fassociative-math -fno-signed-zeros -fno-trapping-math):Small problems (n≤20) are slightly faster; the regression concentrates at n≥60 and is under investigation.
Solver micro-optimisations (
src/,include/)daqp_dot→static inline(include/factorization.h): was a cross-TU call preventing inlining and vectorisation at all call sites. No LTO required.src/auxiliary.c):work->lam_star[i]indexed 4–6 times per outer iteration indaqp_compute_primal_and_fval; hoisted tolam_i.src/factorization.c): localscaledvariable avoids double-read ofwork->L[disp]; localsumused directly for singularity check instead of re-readingwork->D[n_active].src/factorization.c): cachework->D[i]inDito avoid two array reads; reorderw[r]/L[disp]update to break store-load dependency chain.daqp_activate_constraintscorrectness fix (src/auxiliary.c): overdetermined initial working set now correctly distinguishes immutable (equality) constraints that cannot be silently deactivated, rather than blindly clearing all remaining active bits.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.