[ https://issues.apache.org/jira/browse/WICKET-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17096938#comment-17096938 ]
Emond Papegaaij commented on WICKET-6774: ----------------------------------------- These are my numbers with the fixed testcase: {code} WICKET-6774 branch: Benchmark Mode Cnt Score Error Units ComponentBenchmarks.detachComponent thrpt 10 20057.391 ± 419.863 ops/s ComponentBenchmarks.detachComponentWithBehavior thrpt 10 8915.848 ± 226.096 ops/s ComponentBenchmarks.detachComponentWithBehaviorAndMetaData thrpt 10 7955.890 ± 103.236 ops/s ComponentBenchmarks.detachComponentWithMetaData thrpt 10 17444.035 ± 207.528 ops/s ComponentBenchmarks.detachComponentWithModel thrpt 10 7289.186 ± 101.425 ops/s ComponentBenchmarks.detachComponentWithModelAndBehavior thrpt 10 4159.578 ± 56.863 ops/s ComponentBenchmarks.detachComponentWithModelAndMetaData thrpt 10 4466.525 ± 101.193 ops/s ComponentBenchmarks.detachComponentWithModelBehaviorAndMetaData thrpt 10 3460.594 ± 132.584 ops/s master: Benchmark Mode Cnt Score Error Units ComponentBenchmarks.detachComponent thrpt 10 12905.077 ± 273.182 ops/s ComponentBenchmarks.detachComponentWithBehavior thrpt 10 6632.926 ± 109.922 ops/s ComponentBenchmarks.detachComponentWithBehaviorAndMetaData thrpt 10 6448.901 ± 106.836 ops/s ComponentBenchmarks.detachComponentWithMetaData thrpt 10 12980.235 ± 188.695 ops/s ComponentBenchmarks.detachComponentWithModel thrpt 10 6660.698 ± 56.481 ops/s ComponentBenchmarks.detachComponentWithModelAndBehavior thrpt 10 3985.500 ± 54.724 ops/s ComponentBenchmarks.detachComponentWithModelAndMetaData thrpt 10 5019.874 ± 74.391 ops/s ComponentBenchmarks.detachComponentWithModelBehaviorAndMetaData thrpt 10 3813.014 ± 36.410 ops/s {code} > Separate model, behaviors and metadata into separate fields > ----------------------------------------------------------- > > Key: WICKET-6774 > URL: https://issues.apache.org/jira/browse/WICKET-6774 > Project: Wicket > Issue Type: Improvement > Components: wicket-core > Affects Versions: 9.0.0-M5 > Reporter: Thomas Heigl > Priority: Major > Attachments: benchmarks.png > > > While investigating performance issues with metadata in WICKET-6771, I > discovered that significant performance gains can be achieved by separating > models, behaviors, and metadata into separate fields. > Currently, all three types of data are stored in a single, untyped field > {{Component.data}}. The idea is to minimize memory overhead by creating as > few objects as possible. > If a model or a single behavior or metadata is added, {{data}} stores only a > reference to the object. When additional data is added, the reference becomes > an array. > This is the most memory-efficient way to store these three types of data. But > it comes with a cost: code to manipulate that data structure is complex and > not as efficient because it has to take all possible combinations of data > into account. > I suggest introducing 3 separate fields for the 3 types of data, trading a > little bit of memory for reduced complexity and performance gains. -- This message was sent by Atlassian Jira (v8.3.4#803005)