Performance Optimization. Non-cropped Status-Map. Dependency Cleanup. Path-Trie + Cached executed.#12
Open
SerhiiRI wants to merge 2 commits intofeat/console-debug-and-update-documentationfrom
Conversation
…zations, execute config map, updated docs and tests BREAKING execute 3rd arg is now config map instead of binding. Removed :all-inside-recur and :point-and-all-inside-recur dependency modes. Removed print-stats/print-trace from utils. Changed execute-trace signature. ADDED commando.debug namespace — execute-debug with 6 display modes, execute-trace for nested call tracing. ADDED commando.impl.pathtrie — trie for O(depth) command lookup, built during find-commands pass. ADDED status-map keys: :internal/cm-results, :internal/path-trie, :internal/original-instruction. OPTIMIZED find-commands (transient queue + set), execute-commands (transient results, index loop), build-dependency-graph (trie-based, transients), topological-sort (transient maps/queue), CommandMapPath (cached hash), Malli validation (pre-computed validators). FIXED execute-command-impl guard for non-map command-data. Fixed point dependency error data. UPDATED resolve-relative-path and find-anchor-path refactored to loop. Updated README, docs, tests split and .cljc conversion.
…ning about replacemnt for deftype constructor ->CommandMapPath
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.
Breaking Changes
BREAKING
executeaccepts an optional third argument — a config map that replaces the oldbinding-based*execute-config*dynamic var for passing options. Users no longer need(binding [utils/*execute-config* {...}] (execute ...)).(execute registry instruction)— unchanged(execute registry instruction {:error-data-string false})— new opts map:error-data-string,:hook-execute-start,:hook-execute-endBREAKING
execute-tracesignature changed from(execute-trace exec-fn)to(execute-trace registry instruction)/(execute-trace registry instruction opts). No longer requires wrapping in a zero-arg function.BREAKING Removed
:debug-resultconfiguration option. Internal structures (:internal/cm-list,:internal/cm-dependency,:internal/cm-running-order,:internal/path-trie,:internal/cm-results,:internal/original-instruction,:registry) are now always retained in the status-map. If you relied on stripped status-maps, dissoc internal keys yourself.BREAKING Removed dependency modes
:all-inside-recurand:point-and-all-inside-recur. Supported modes::point,:all-inside,:none.BREAKING Removed
print-stats,print-trace(print-deep-stats) fromcommando.impl.utils. Replaced bycommando.debugnamespace.BREAKING
registry_test.cljrenamed toregistry_test.cljc(cross-platform).BREAKING status-map return result as is
Added
ADDED
commando.debugnamespace — dedicated module for debug visualization:execute-debug— execute and visualize in one of six display modes::tree,:table,:graph,:stats,:instr-before/:instr-after. Supports combining multiple modes via vector.execute-trace— trace all nestedcommando/executecalls with timing and structure.ADDED
commando.impl.pathtriemodule — trie data structure for O(depth) command lookup by path. Built during the same traversal pass as command discovery, eliminating extra passes over the instruction tree.ADDED new status-map keys always present after execution:
:internal/cm-results— map{CommandMapPath -> resolved-value}with result of each command's:applyfunction.:internal/path-trie— nested trie for efficient command lookup by path.:internal/original-instruction— the original instruction before command evaluation.ADDED
structural-command-type?andstructural-command-typesincommando.impl.registryfor detecting internal structural commands (:instruction/_value,:instruction/_map,:instruction/_vec).Performance
OPTIMIZED
find-commandsBFS traversal incommando.impl.finding_commands:enqueue-coll-children!/enqueue-command-children!instead of intermediate mapv vectors.OPTIMIZED
execute-commandsincommando.impl.executing:nthinstead ofrest/firston remaining commands.OPTIMIZED
build-dependency-graphincommando.impl.dependency:find-commandsinstead of rebuilding it.:all-insidedependency resolution usesreduce-kvon trie subtree instead of dissoc+vals+keep+set chain.OPTIMIZED
topological-sortincommando.impl.graph:OPTIMIZED
CommandMapPathincommando.impl.command_map:vector-starts-with?uses indexed loop instead of lazy seq/take.OPTIMIZED Malli validation in
commando.commands.builtin:Fixed
FIXED
execute-command-implincommando.impl.executing— guard for non-mapcommand-databefore callingdissocon driver keys (:=>,"=>).FIXED point dependency errors in
commando.impl.dependencynow include:command-path,:path, and:commandin error data.Updated
UPDATED
resolve-relative-pathincommando.impl.dependency— refactored from reduce to recursive loop for clarity and correct early termination.UPDATED
find-anchor-pathincommando.impl.dependency— refactored from reduce to loop.UPDATED documentation — restructured
README.mdwith comprehensive status-map documentation, improved navigation, "Managing the Registry" and "Debugging" sections. Moved doc files toexamples/with runnable code examples.UPDATED performance test alias from
:performanceto:performance-coreindeps.edn.UPDATED tests — split monolithic
core_test.cljcinto focused namespaces:dependency_test.cljc,finding_commands_test.cljc,graph_test.cljc,pathtrie_test.cljc. Addeddebug_test.cljc. Convertedregistry_testto.cljcfor cross-platform support.