Lucee 7.1 faster, lighter components

Previously, adding accessors=true to a component meant that every instance duplicated property metadata and regenerated getter/setter UDFs - even though these are static metadata that never change at runtime. This added unnecessary memory overhead and slowed down instance creation, especially for components with many properties (also with accessors=false).

This PR implements a flyweight pattern: properties and accessor UDFs are now generated once at bytecode compilation time and shared across all instances of a component class, rather than being duplicated per instance.

Performance improvements observed:

  • 71 fewer garbage collections in accessor-heavy tests
  • 41% faster throughput on dynamic accessor operations
  • ~10% reduction in object allocations

Huh? what? Basically all your CFC instantiations get faster

More details in the ticket

https://luceeserver.atlassian.net/browse/LDEV-3335

This landed in 7.1.0.44-SNAPSHOT. While all tests pass and I’ve done extensive testing, I’d appreciate people trying this out and reporting any issues in this thread.

If you do hit a problem, please also try with 7.1.0.43-BETA so we can confirm whether it was introduced by this change and also mention which version you’re currently running

Remember, 7.1 is still in development, keep in mind, ORM is currently broken with 7.1 due to some OSGI cleanup causing a regression, PR pending since a while

This forms part of my “project turbo” epic for 7.1

https://luceeserver.atlassian.net/browse/LDEV-5919

Also already in 7.1 are some nice compiler performance improvements

https://luceeserver.atlassian.net/browse/LDEV-5832

4 Likes