Open
Conversation
Five optimizations targeting the GanttProjectMixin initial data load: 1. commitAsync uses sync path when onComputationCycle != 'effect' Bypasses all generator overhead for initial commit (41% alone) 2. cachedBaseRevisionLookup short-circuits when base revision is empty Avoids Map lookups + revision chain walks on initial commit (9%) 3. Skip markAndSweep on initial commit No revision history to compact, saves 50K+ Map operations (7%) 4. Fix polymorphic property access deopt in addOutgoingTo Pass identifier explicitly instead of reading from polymorphic Quark subclass (QuarkGen vs QuarkSync). Also adds hasCycles boolean guard to skip Map.has in the hot loop (9%) 5. Avoid template string allocation in createFieldIdentifier Use field.name directly instead of template string per field (2%) Benchmark: 5591ms → 2630ms for 1000x10 Gantt tasks (53% improvement) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1df24bc to
53b2ada
Compare
Replaces getter delegation (this.identifier.calculation and this.identifier.context || this.identifier) with cached instance properties set during newQuark(). Saves ~100K getter calls during initial commit calculation. ~5% improvement. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
During initial commit, entries are never replaced by Write effects, so the Map.get ownership check (entries.get(identifier) !== entry) always passes. Skip it when baseRevisionEmpty is true. Saves ~50K Map.get calls. ~5% faster. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Leftover from abandoned batch-edges experiment. Reduces Transaction property count by 1. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Both sync and gen identifiers now use the same QuarkGen class, eliminating V8 megamorphic property access deoptimization (LoadIC_Megamorphic was ~14% of CPU time). A _isGenCalc flag set at quark creation time branches sync vs gen in startCalculation without runtime type checking. ~5% improvement (2490ms to 2410ms). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
onComputationCycle !== 'effect', bypassing all generator overheadMap.has()in hot loop when no cycles presentBenchmark
All measured in the same session,
node autoresearch/benchmark.mjs --tasks=1000 --chains=10 --runs=5(GanttProjectMixin initial commit):origin/master~25% faster than current master.
Test plan
grunt tests --include=".t.js")onComputationCycle === 'effect')🤖 Generated with Claude Code