Skip to content

perf: monomorphic logevent#575

Merged
lcottercertinia merged 27 commits intocertinia:mainfrom
lukecotter:perf-monomorphic-logevent
Aug 28, 2025
Merged

perf: monomorphic logevent#575
lcottercertinia merged 27 commits intocertinia:mainfrom
lukecotter:perf-monomorphic-logevent

Conversation

@lukecotter
Copy link
Copy Markdown
Contributor

@lukecotter lukecotter commented Feb 21, 2025

Description

The goal of this PR is to improve Log Parser performance, primarily through ensuring objects are monomorphic which helps engines optimise especially in tight loops.

It will also address some other performance improvements and restructure the files e.g separate file for the types

  • Consistent field assignment order
  • Use simple objects instead of classes where possible

Type of change (check all applicable)

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor
  • ⚡ Performance Improvement
  • 📝 Documentation
  • 🔧 Chore
  • 💥 Breaking change

[optional] Any images / gifs / video

Related Tickets & Documents

resolves #552
Related Issue #
fixes #
closes #

Added tests?

  • 👍 yes
  • 🙅 no, not needed
  • 🙋 no, I need help

Added to documentation?

  • 🔖 README.md
  • 🔖 CHANGELOG.md
  • 📖 help site
  • 🙅 not needed

[optional] Are there any post-deployment tasks we need to perform?

- Use a single while loop instead of 2 + removes len decrement
- Remove the need for Map to represent levels
Pipes the fetch repsonsse through TextDecoderStream.
We still read the full log content into memory but we do not block the main thread.

It also open up a migration to reading the log line by line
later instead of all into memory which will help with memory.
- ApexLogParser.ts - Main parser logic
- LogEvents.ts - All log event classes
- LogLineMapping.ts - Mapping of log event types to classes
- types.ts - Types and interfaces
@lcottercertinia
Copy link
Copy Markdown
Collaborator

Some changes have moved to #612.
Some of these and future changes in this PR are too risky this close to release.

@lcottercertinia lcottercertinia marked this pull request as draft May 2, 2025 10:42
@lukecotter lukecotter force-pushed the perf-monomorphic-logevent branch 2 times, most recently from 90a165b to 5fde7a1 Compare May 23, 2025 09:29
@lukecotter lukecotter force-pushed the perf-monomorphic-logevent branch from 1ec0544 to 4cd7dcb Compare August 13, 2025 16:12
@lcottercertinia lcottercertinia marked this pull request as ready for review August 28, 2025 15:21
@lcottercertinia lcottercertinia merged commit d7d0054 into certinia:main Aug 28, 2025
5 checks passed
@lukecotter lukecotter deleted the perf-monomorphic-logevent branch August 28, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: Apex log parser performance improvements

2 participants