Recent Activities
This page shows what are we working on.
-
1.4.5
-
1.4.4
-
head
-
head
-
head
-
perf: Fix DeferJs regression - revert to native DOM (16x faster)
Commit f4977f5 (Oct 13) introduced TrackedDomDocument methods which add
expensive tracking overhead. Reverting to native removeChild/appendChild.
Results:
- moveScriptsToBodyEnd: 0.078s → instant
- DeferJs: 0.082s → 0.005s (16.4x faster)
- Coordinator: 0.213s → 0.158s (1.35x faster)
Fix: Use native DOM + context.markDirty() for correct patch regeneration. aab2e3 -
perf: Remove SignatureOffsetFinder and add profiling (11x faster)
Removed SignatureOffsetFinder strategy which consumed 91% of indexing time.
Added profiling to Chain and Tracker for performance analysis.
Performance:
- indexNodes: 0.243s → 0.022s (11x faster)
- Coordinator: 0.448s → 0.213s (2.1x faster)
- indexNodes as % of total: 54.5% → 10.3%
Coverage: All nodes still indexed by FastTag, ParentContext, and Content strategies. 348919 -
PatchManager: exact regex check for <html>/<head>/<body>, better logging 5f56f4
-
perf DirectMatchStrategy: clean up and document core fast/UTF-8 replacement logic 2eb9cf
-
OffsetBasedStrategy: drop global ASCII cache; use local fragment check only, cleanup profiling 864be2
-
FastTagOffsetFinder: skip duplicated tags, delegate ambiguous offset matching to safe strategies 965136
-
TrackedDomDocument: robust UTF-8 charset handling, correct structure restoration, and extensive encoding tests ac2673
-
LCP Optimizer: batch node indexing, XPath constants, and TrackedDomDocument fixes cad15d
-
fix(TrackedDomDocument): Fix UTF-8 with meta charset injection
Problem: DOMDocument converts UTF-8 (Σχετικά) to entities (Σ...)
Solution: Inject <meta charset=utf-8>, then remove after parsing
Changes:
- addUtf8Charset(): inject meta tag (document/fragment aware)
- removeUtf8Charset(): cleanup meta + extract body for fragments
- Proper libxml error handling (no @ suppression)
Result: UTF-8 preserved, testBomIsRemovedFromOutput ✅ PASS
Technical: Forces libxml UTF-8 mode, saveHTML() outputs UTF-8 correctly 76abb7 -
perf(OffsetBasedStrategy): Fix UTF-8 handling and add ASCII detection cache
**Problems fixed:**
1. UTF-8 characters incorrectly handled - byte/char offset mismatch
2. Performance bottleneck - repeated mb_strlen() on large HTML
**Solutions:**
1. Convert byte offset to character offset for mb_substr
2. Cache ASCII detection (xxh3 hash, 100 entry limit, FIFO)
3. Remove broken isUtf8Safe() - use reliable ASCII check
**Performance:**
- 500KB HTML, 100 patches: 500ms → 15ms (33x faster)
- Cache hit rate: 99%+ expected
**Stats:** cache_hits, cache_misses, cache_hit_rate added 9c537c -
refactor: manual node indexing in TrackedDomDocument, update pipeline/context a758d3
-
-
1.16.5
-
Version 1.16.5 c554e1
-
perf: Optimize OffsetBasedStrategy - 41x faster (mb_* → substr_replace) part II e0e005
-
perf: Optimize OffsetBasedStrategy with fast path and UTF-8 fallback
- Replace slow mb_* functions with fast substr_replace/strpos
- Add exact offset check before radius search (80% hit rate)
- Add UTF-8 safety validation with fallback to mb_substr
- Add profiling and statistics tracking
- Expected speedup: 0.170s → 0.030s (5. 6x faster)
Performance impact:
- OffsetBased: 0.124s → ~0.014s (9x faster)
- Total applyPatches: 0.170s → ~0.030s
- Pagespeed: 0.377s → ~0.240s (36% faster) ce351b -
perf(tracker): optimize node indexing with combined XPath queries
Improve indexNodePositions() performance by:
- Combining simple XPath queries into single expression (//img | //script | ...)
- Using SplObjectStorage for automatic node deduplication
- Adding graceful fallback to individual queries if combined query fails
- Moving error details to debug mode only
Implementation:
- New method: findNodesToIndex() - handles query execution and deduplication
- New method: canCombineQueries() - validates if queries can be combined
- New method: combineQueries() - creates combined XPath expression
- New method: convertStorageToArray() - converts SplObjectStorage to indexed array
Performance impact:
- indexNodePositions: 0.056s → 0.045s (~20% faster)
- Combined with FastTagOffsetFinder: 0.320s → 0.045s (7. 1x total improvement)
- XPath queries: 5 separate DOM scans → 1 combined scan
Debug improvements:
- Added logging for combined query usage (debug mode only)
- Moved stack traces to debug mode only
- Added node count logging after successful query 3ae16d -
feat(performance): add FastTagOffsetFinder strategy for 5.75x speedup
Add optimized offset finder for common tags using pre-built index.
Performance: indexNodePositions 0.320s → 0.056s (5.75x faster) ba5d58 -
test: fix tests for selective XPath indexing
Pass explicit XPath queries in tests after removing '//*' fallback. ff46ce -
feat(tracker): add XPath query validation with debug-aware logging
- Add try-catch around XPath query execution
- Log warnings for invalid queries (graceful degradation)
- Log errors for execution failures with file/line context
- Include full stack trace only in debug mode
- Early return if no nodes found to index
- Continue processing remaining queries on failure
Improves robustness: invalid XPath from optimizers won't break indexing,
and production logs remain clean while debug mode provides full context. 985abb -
Merge branch 'master' of github.com:swissup/module-pagespeed b6a4ee
-
refactor(dom): move default XPath queries to Tracker
- Define Tracker:: DEFAULT_XPATH_QUERIES constant
- Tracker uses own default when no queries provided
- Pipeline references Tracker's default instead of duplicating
- Remove hardcoded defaults from TrackedDomDocument
- Eliminate '//*' fallback to avoid performance issues
Single source of truth: Tracker owns indexing logic and default queries. 1d81d0
-
-
1.0.9
-
1.0.8
-
2.12.2
-
2.12.1