Repository navigation
[capi] Scan the data access widths while warming - #1350
Merged
Merged
Conversation
A C view reads the widths of the image's data accesses, which a scan of every function's instructions finds and the session keeps while the functions' extents stay. The first view of a session paid for the scan even after warming had prepared its function: 40-150 ms of a first decompile that otherwise takes a few. neverd_warm_functions_json makes the scan where nothing waits on it, as that view would; a view whose function list has changed scans again, and reloads, edits and policy changes drop it as before.
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
A C view reads the widths of the image's data accesses (
Session::dataAccessWidths), which a scan of every function's instructions finds. The session keeps the result while the functions' extents stay. The first C view of a session paid for that scan, even when warming had already prepared the function. On the corpus the scan is most of the first decompile after opening: 40–150 ms against a few ms for every later one.neverd_warm_functions_jsonnow makes the scan in its first call, where nothing waits on it, exactly as that first view would. The session keeps it as before:The API comment and the architecture guide say so.
Measurements
Release build, NEVERD_THREADS=4, pinned to 4 CPUs. Each run opened with warming, waited for it to finish, and then decompiled the image's first five functions. Two runs per side, alternating.
devLater decompiles and the time warming takes are unchanged within noise. Decompiling every function of the probe (565) and the DLL (338) gives identical sources either way.
Tests
SessionCAPITest.WarmingScansTheDataAccessWidthsTheFirstViewReads:NeverDSessionCAPITests173/173,NeverDPipelineOutcomeTests42/42 and the worker tests with the real engine (ctest -R NeverDWorker, 36/36) pass.dev:NeverDSessionCAPITests174/174.scripts/check_clang_format.pypasses.scripts/check_docs_i18n.pyfails ondevalready, ondocs/zh-CN/process-emulation.md(missing tokenrevents), a file this change does not touch.