[
https://issues.apache.org/jira/browse/WICKET-1862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12637892#action_12637892
]
Johan Compagner commented on WICKET-1862:
-----------------------------------------
those changes gained 30% memory in the project martijn was talking about
also your assumption is incorrect.
if you just has a model then that reference is not an object[] but just
directly the model!
same goes for everything if you just have no model but you have 1 behavior :
then that is only a reference to a behavior nothing more.
only when you have all 3 of them so you have a model, a behavior and metadata
this would have the Object[] reference overhead.
but 99% of the components dont have that mix. They have nothing, 8 bytes saved
per component, or they have just 1, still 8 bytes saved per component..
The thing you are proposing is not so saving anymore why?
Because what happens if you have just 1 (model or behavior or metadata)? then
you also have a IComponentExtra with just a behavior or model field?
then we suddenly only save 4 bytes instead 8.
Do remember this is per component.. and thats a load. Pages can have many
hundreds of components in one page. that over multiply pages and multply
sessions
then those numbers add up rapidly.
> Please consider backing out changes to Component that merged dissimilar
> objects into an Object[]
> ------------------------------------------------------------------------------------------------
>
> Key: WICKET-1862
> URL: https://issues.apache.org/jira/browse/WICKET-1862
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.3.4
> Reporter: Willis Blackburn
> Priority: Minor
>
> In Wicket 1.2, the members of the Component class were pretty straightforward.
> But in 1.3, three fields, including the model, have been merged into a single
> Object[], and there are new methods called data_get, data_set, data_length,
> data_add, data_remove, and data_insert, to deal with the array.
> I cannot determine from the source code why this was done, but it does not
> seem like a change for the better. The Component class is now very
> confusing, and the change has also made working with any Component subclass
> (in other words, practically every Wicket class!) in the debugger more
> difficult. I think that when three fields that used to be accessed in a
> simple and straightforward manner are replaced by 160 lines of code, there
> needs to be some very compelling reason.
> Maybe the motivation was to reduce the memory footprint of a Component
> instance that does not have any model, behaviors, or metadata, or maybe one
> that just has one of the three? If so, is that really so compelling? Is the
> memory footprint that large? Are users suffering from problems that have
> been addressed by this solution? In the context of the memory usage of a
> typical webapp, saving something like 8 bytes per Component instance does not
> seem like that much.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.