Remove local strings from timing - #12513
Open
simonrozsival wants to merge 11 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the shared native fast-timing implementation to stop using dynamic_local_string for formatting and option parsing, moving toward fixed-buffer (char[]) handling to reduce reliance on the local-string hierarchy and eventually C++ runtime dependencies in shared native code.
Changes:
- Switch timing option retrieval/parsing (
debug.mono.timing) to fixed buffers and in-place C-string tokenization. - Replace timing log/event message construction with fixed
chararrays andsnprintf, returning event descriptions as string literals. - Add
AndroidSystem::monodroid_get_system_propertyoverloads that write directly into caller-providedchar[]buffers (MonoVM and CLR variants).
Show a summary per file
| File | Description |
|---|---|
| src/native/mono/runtime-base/android-system.hh | Adds char[] overload for system property retrieval on the MonoVM side. |
| src/native/common/runtime-base/timing-internal.cc | Migrates timing option parsing, log message formatting, and output path building to fixed buffers. |
| src/native/common/include/runtime-base/timing-internal.hh | Updates timing message formatting helpers to use fixed buffers and snprintf. |
| src/native/clr/include/runtime-base/android-system.hh | Adds char[] overload for system property retrieval on the CLR side. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Lite
simonrozsival
force-pushed
the
dev/simonrozsival/remove-timing-dynamic-strings
branch
from
August 25, 2026 15:06
6b89b87 to
1e2809e
Compare
simonrozsival
changed the base branch from
main
to
dev/simonrozsival/use-join-paths-for-logger
August 25, 2026 15:10
simonrozsival
force-pushed
the
dev/simonrozsival/remove-timing-dynamic-strings
branch
2 times, most recently
from
August 25, 2026 15:29
176c7d7 to
75a294a
Compare
simonrozsival
force-pushed
the
dev/simonrozsival/remove-timing-dynamic-strings
branch
8 times, most recently
from
August 25, 2026 21:50
737279b to
d9fb4b3
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The fixed timing buffers reduce libmonodroid.so from 1,184,800 to 1,094,848 bytes. Refresh all four affected CoreCLR package baselines using build 1566719 output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Assembly store timing metadata no longer uses the local-string types. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Allocate timing metadata to its exact size instead of treating the former local-string stack threshold as a maximum. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use malloc only when assembly timing information exceeds the former local-string stack threshold. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Retry timing metadata formatting with exact heap storage only when the sensible stack buffer is insufficient. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Route assembly timing heap-buffer cleanup through the same helper as temporary path buffers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rely on free(nullptr) and name the stack-backed timing buffer explicitly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eliminate the separate heap pointer and free assembly timing storage only when it differs from the stack buffer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
simonrozsival
force-pushed
the
dev/simonrozsival/remove-timing-dynamic-strings
branch
from
August 25, 2026 22:23
d9fb4b3 to
f02f1d2
Compare
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.
Summary
Remove the shared fast-timing implementation's local-string dependencies without introducing limits based on their former inline-storage thresholds.
Changes
malloc()storageTMPDIRand close the output file on setup failurestrings.hhdependency1566719Validation
1566719