github carthage-software/mago 1.0.0-alpha.6
Mago 1.0.0-alpha.6

latest releases: 1.0.0-beta.10, 1.0.0-beta.9, 1.0.0-beta.8...
26 days ago

This is a major performance-focused release, delivering significant improvements to both execution speed and memory usage. Through a series of targeted optimizations, Mago is now substantially faster on small-to-medium codebases and drastically leaner on large ones.


🚀 Performance Improvements

This release cycle has been dedicated to making Mago faster and more efficient. Benchmarks comparing this release (1.0.0-alpha.6) with 1.0.0-alpha.4 show the following results ( mago analyze ):

Project Metric 1.0.0-alpha.4 1.0.0-alpha.6 Improvement
PSL (Small) Speed 143.2 ms 118.6 ms ~21% Faster
Memory 174.80 MB 154.67 MB -11.5% Memory
WordPress (Large) Speed 7.016 s 6.692 s ~5% Faster
Memory 2065.36 MB 1855.00 MB -10.2% Memory

On the large WordPress codebase, these changes resulted in over 210 MB of RAM savings, making the analyzer more capable of handling massive projects.

Key optimizations include:

  • Span Size Reduction: The core Span struct was reduced in size by 50% (from 32 to 16 bytes), dramatically lowering memory usage.
  • Parallel File Loading: The database loader now uses rayon to discover and read files in parallel, providing a significant speedup on small projects.
  • Efficient Data Structures: Core data structures in the codex and algebra crates were migrated from BTreeMap to IndexMap for faster lookups.
  • Memory Sharing with Cow and Arc: The database was refactored to use Copy-on-Write strings and Arc to share file data cheaply across threads.

🐛 Fixes & Improvements

  • CI & Tests: Corrected a build failure and fixed broken tests that affected the 1.0.0-alpha.5 release.
  • Stubs: Added missing public properties to the DateInterval class stub for more accurate analysis. (by @Bleksak in #273)
  • Analyzer: Improved template type inference when converting between list and keyed arrays.
  • Formatter: Fixed an issue where the formatter would incorrectly add newlines for arguments that were already multi-line constructs. (Closes #244)
  • Typos: Corrected various typos across multiple crates. (@szepeviktor in #276)

🛠️ Chores & Refactoring

  • Docs: Improved the formatting of the main README.md file. (by @szepeviktor in #278)
  • The rand dependency has been removed from the mago-algebra crate.
  • Unnecessary #[repr(C)] attributes were removed from AST and span structs.
  • Added new badges to the project README.

New Contributors


Full Changelog: 1.0.0-alpha.4...1.0.0-alpha.6

Don't miss a new mago release

NewReleases is sending notifications on new releases.