Conversation
The project set no CMAKE_BUILD_TYPE and no optimisation flag anywhere, and neither docker/Dockerfile nor docker/Dockerfile.cpu passes one. An unset build type is not a neutral default -- CMake then emits no -O flag at all, so every binary built from this repo, the released container images included, was compiled -O0. That is measurable, not theoretical. Disassembling a shipped aarch64 binary, the input tensor normalisation in modules/models carried not one vector instruction, reloaded MEAN and STD from memory on every iteration and issued a scalar fdiv per element. On a Cortex-A720 it cost 14.4 ms per 1024x512 image against 0.6 ms for the same source compiled -O3, and the per-frame conversion runs that loop three times. Default to Release when the user has not chosen, leave any explicit -DCMAKE_BUILD_TYPE alone, and offer the four standard types to cmake-gui and ccmake. Release rather than RelWithDebInfo is deliberate: -O2 leaves that conversion completely unvectorised, and only -O3 turns it into the NEON de-interleaving loop it should be. Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
youtalk
force-pushed
the
fix/build-default-release
branch
from
September 10, 2026 00:14
696672c to
153d2d2
Compare
youtalk
marked this pull request as ready for review
September 10, 2026 01:11
This branch has not been deployed
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.
What
Default
CMAKE_BUILD_TYPEtoReleasewhen the user has not chosen one, leave any explicit-DCMAKE_BUILD_TYPEalone, and offer the four standard types tocmake-gui/ccmake.Why
The project sets no build type and no optimisation flag anywhere, and neither
docker/Dockerfilenordocker/Dockerfile.cpupasses one. An unset build type is not a neutral default: CMake then emits no-Oflag at all, so every binary built from this repo, the released container images included, is compiled-O0.That is measurable, not theoretical. Disassembling a shipped aarch64 binary, the per-frame input tensor normalisation in
modules/modelscarried not one vector instruction, reloadedMEANandSTDfrom memory on every iteration, and issued a scalarfdivper element:objdump | grep -cE "\.4s|\.8h|\.16b"over that whole function returned 0.Effect, measured
On an R-Car X5H (Cortex-A720), one clip, 198 inferred frames, same source built the same way apart from this commit:
-O0)Release)Per 1024x512 image, that one conversion goes from 14.4 ms to 6.4 ms, and it runs three times a frame. Nothing here is board-specific — the affected code is plain CPU work on the shared pipeline, so an x86_64 host running the CUDA or TensorRT provider was compiled
-O0too.Why
Releaseand notRelWithDebInfoDeliberate, and the difference is not cosmetic.
-O2leaves that conversion completely unvectorised — measured 0 vector instructions in the loop at-O2, against a NEONld3de-interleaving loop at-O3. OnlyReleasegets the win.Risk
Releaseadds-DNDEBUG, which disablesassert(). Checked before choosing it: there are no non-static_assertassert()calls anywhere undermodules/orapp/, so nothing changes behaviourally.Verification
Built
docker/Dockerfile.cpuon this branch: the configure step reportsBuild type: Release,-O3reaches the actual compile lines, theVisionPilottarget links, and-DCMAKE_BUILD_TYPE=Debugis still respected.Relation to the other two PRs
This is the first of three independent changes; the other two are opened alongside it and none of them depends on this one to build. Suggested review/merge order is this PR, then the input-tensor fusion, then the merged-graph NPU backend, because the later two are measured on top of a
Releasebuild.Note on
spell-check-differentialThe check is red, and none of it comes from this branch.
spell-check-differentialscans every changed file in full, so it reports words that already live in those files onmain—Ipopt,libnice,CPACK,cipo,latc,Matx,dets, and the forbiddenROS2among them. The same check has been failing onmaininspell-check-dailyevery night for at least a week, and the last two merged PRs (#408, #411) merged red on it too. Every word this branch actually introduces is either already in the shared dictionary or added to.cspell.jsonhere, verified locally with cspell against the repo config.