Commit Graph

79 Commits

Author SHA1 Message Date
Michael Freno
f4dc92907c scrolling improvements 2025-12-06 10:37:07 -05:00
Michael Freno
abe34c4749 Implement algorithmic performance optimizations
Implemented high-impact optimizations from PERFORMANCE_ANALYSIS.md:

1. Dirty Flag System (30-50% fewer layouts):
   - Added _dirty and _childrenDirty flags to Element module
   - Elements track when properties change that affect layout
   - LayoutEngine checks dirty flags before expensive layout calculations
   - Element:setProperty() invalidates layout for layout-affecting properties

2. Dimension Caching (10-15% faster):
   - Enhanced _borderBoxWidth/_borderBoxHeight caching
   - Proper cache invalidation in invalidateLayout()
   - Reduces redundant getBorderBox calculations

3. Local Variable Hoisting (15-20% faster):
   - Hoisted frequently accessed properties outside tight loops
   - Reduced table lookups in wrapping logic (child.margin cached)
   - Optimized line height calculation (isHorizontal hoisted)
   - Heavily optimized positioning loop (hottest path):
     * Cached element.x, element.y, element.padding
     * Hoisted alignment enums outside loop
     * Cached child.margin, child.padding per iteration
     * 3-4 table lookups → 2 lookups per child

4. Array Preallocation (5-10% less GC):
   - Preallocated lineHeights with table.create() when available
   - Graceful fallback to {} on standard Lua

Estimated total gain: 40-60% improvement (2-3x faster layouts)
All 1257 tests passing. Zero breaking changes.

See ALGORITHMIC_OPTIMIZATIONS.md for full details.
2025-12-05 14:43:46 -05:00
Michael Freno
7883f914d9 blur uses radius instead of intensity 2025-12-05 11:31:52 -05:00
Michael Freno
61500f9131 added theme state locks 2025-12-04 20:34:21 -05:00
Michael Freno
3ee4bf1786 removed old cleanup, fix inputs 2025-12-04 00:17:04 -05:00
Michael Freno
efce61d077 streamling errorhandler calls 2025-12-03 22:19:27 -05:00
Michael Freno
940353c1ad state persistance consolidation 2025-12-03 14:34:47 -05:00
Michael Freno
d3014200da memory tooling, state handling changes 2025-11-25 09:50:57 -05:00
Michael Freno
9918df5ea8 testing cleanup, and stop lsp warnings due to profiling 2025-11-21 13:03:59 -05:00
Michael Freno
92068d5315 trying to get coverage analysis to reasonable time 2025-11-20 14:27:34 -05:00
Michael Freno
d0357672db cleanup stale tests, profiling reports 2025-11-20 11:36:41 -05:00
Michael Freno
57eb52e70d continued refactor 2025-11-19 16:49:34 -05:00
Michael Freno
21a4a29cf1 element refactor - will return to this 2025-11-19 16:14:35 -05:00
Michael Freno
e778815c5e begin major Element refactor 2025-11-19 15:37:08 -05:00
Michael Freno
b24af17179 starting refactor for sanity 2025-11-19 12:14:58 -05:00
Michael Freno
d86f7dbd5e docs improvement 2025-11-18 19:51:05 -05:00
Michael Freno
96150e5cf4 more work on Animation 2025-11-18 19:51:05 -05:00
Michael Freno
6f3fa0e473 update type defs 2025-11-18 19:51:05 -05:00
Michael Freno
9f147c1d84 image and animation progress 2025-11-18 19:51:05 -05:00
Michael Freno
2c04f69daa Performance and reporting improvements 2025-11-17 17:41:01 -05:00
Michael Freno
e5e7b55709 Replacing errors with warns in non-critical areas 2025-11-17 01:56:02 -05:00
Michael Freno
a1a4ebc4b1 merging tests 2025-11-14 23:13:34 -05:00
Michael Freno
2504ae506e better unit check error 2025-11-14 22:49:08 -05:00
Michael Freno
f35bb11770 element di migration 2025-11-14 22:41:24 -05:00
Michael Freno
a218b4abed some consolidation 2025-11-14 17:16:55 -05:00
Michael Freno
db2f5b43c9 fix immediate mode state update/draw ordering 2025-11-14 10:26:46 -05:00
Michael Freno
93af33825d immediate mode scroll regression fixed 2025-11-13 22:33:53 -05:00
Michael Freno
7ae09ec690 fix children of absolute positioning 2025-11-13 21:13:37 -05:00
Michael Freno
9da8d589a1 fixed 2025-11-13 21:01:04 -05:00
Michael Freno
7e69e7f544 oops 2025-11-13 20:50:18 -05:00
Michael Freno
3373d43b1b fix Gui references 2025-11-13 20:42:47 -05:00
Michael Freno
614536a3df rename and simplification 2025-11-13 17:38:19 -05:00
Michael Freno
252cd37f3c start of error handling 2025-11-13 09:59:26 -05:00
Michael Freno
64aef0daf1 merge theme/thememanager 2025-11-13 08:51:53 -05:00
Michael Freno
6a14b277f9 removing excessive comments 2025-11-13 00:48:50 -05:00
Michael Freno
225dff8f74 typings 2025-11-13 00:17:55 -05:00
Michael Freno
de4167a7b6 include blur props 2025-11-12 23:56:59 -05:00
Michael Freno
42704660b2 remove asserts 2025-11-12 23:38:13 -05:00
Michael Freno
b886085d3e change to DI 2025-11-12 23:30:29 -05:00
Michael Freno
84f45a019b removed redundant methods 2025-11-12 21:52:36 -05:00
Michael Freno
6b28be0820 Restore Phase 1 text wrapping delegation to Renderer 2025-11-12 21:19:48 -05:00
Michael Freno
47ec641eb9 Revert Phase 2 text calculations changes - broke layout 2025-11-12 21:18:44 -05:00
Michael Freno
8206f96867 continued refactor 2025-11-12 21:16:35 -05:00
Michael Freno
3df8718a62 theme manager module 2025-11-12 20:56:06 -05:00
Michael Freno
91e4af9b96 event handler and scrollmanager 2025-11-12 20:23:11 -05:00
Michael Freno
d2f9c70601 renderer extraction started - complicated 2025-11-12 19:16:13 -05:00
Michael Freno
73044cfd6c layoutengine extracted 2025-11-12 18:58:24 -05:00
Michael Freno
1293ca81a4 restart 2025-11-12 17:53:22 -05:00
Michael Freno
7faa8b4ec6 modularizing (broken) 2025-11-12 17:19:46 -05:00
Michael Freno
9e18b67a64 fix non-code references 2025-11-11 13:17:45 -05:00