Skip to content

Log Caching, Faster Polling, and Performance Upgrades

Choose a tag to compare

@captincrum captincrum released this 29 May 17:53
· 32 commits to main since this release

2.6.0 – Log Caching, Faster Polling, and Performance Upgrades

Server (web_server.ps1)

  • Added in‑memory log cache with incremental reads using FileStream.Seek
  • Added /logs/total endpoint for zero‑I/O line‑count retrieval
  • Added /logs/search endpoint with backslash‑aware server‑side filtering
  • Added /status-all endpoint combining console status and log count
  • Rewrote /logs/slice to parse only requested ranges from cache
  • Updated /logs/clear to fully reset cache state
  • Improved file‑lock handling to safely skip updates when workers hold the file

Client (web_app.js)

  • Poller now checks /logs/total first to avoid unnecessary slice fetches
  • Switched to setTimeout chaining with idle backoff to prevent stacked requests
  • Console and log polling unified through /status-all
  • Search filter now uses server‑side /logs/search with 300ms debounce
  • Clearing filters reloads fresh data instead of reusing stale results
  • Updated UI actions to use server‑side search instead of full‑log fetches
  • Button handlers now use apiLogTotal() for counts
  • Removed virtual scroll spacer in live mode
  • Scroll‑up behavior now pages back a flat 200 entries
  • Added stale‑state guards to prevent incorrect UI rendering after async operations

Scan Resume (Modules_Scan.psm1)

  • Skip‑list now reads raw lines and parses only relevant entries
  • Replaced O(n²) scan in UM-IsScanned with HashSet<string> for O(1) lookups
  • Eliminated ~222 million comparisons on large libraries

Logging (Modules_Logging.psm1)

  • Fixed double‑newline issue in UM-AppendLogEntry
  • Added UM-LogShowComplete for future completion‑marker support

UI (web_app.js / web_style.css)

  • Fixed blank‑line spacing in machine logs
  • Added .machine-log class for machine‑mode‑specific formatting
  • Removed redundant client‑side filtering in renderLogFile