[JIRA] (JSSH-30) Consider removing the LazyMap/Set/List

Ian Young (Jira) jira at shibboleth.atlassian.net
Thu May 4 10:35:03 UTC 2023


Ian Young ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ae127cb03-43ed-473d-b6ba-592949cb4be8 ) *commented* on JSSH-30 ( https://shibboleth.atlassian.net/browse/JSSH-30?atlOrigin=eyJpIjoiNmFhMTU0ZDM5NjFlNDAwMTkzZWRiZWRmNDllYTNhNDkiLCJwIjoiaiJ9 )

Re: Consider removing the LazyMap/Set/List ( https://shibboleth.atlassian.net/browse/JSSH-30?atlOrigin=eyJpIjoiNmFhMTU0ZDM5NjFlNDAwMTkzZWRiZWRmNDllYTNhNDkiLCJwIjoiaiJ9 )

I think the original idea with these was that there were contexts (particularly in the OpenSAML XML objects?) where you were likely to be creating a zillion objects wrapping a lot of containers, and the majority of those were going to be empty, but could become non-empty during normal operation. So this is there to optimise that specific case. As to whether that makes sense, perhaps some measurement was originally done to justify it but by the same token we could do some measurement to find out what would change if we just always called buildSet() or whatever on construction to simulate removing these. My suspicion is they’re probably not worth keeping, but it will depend a lot on how they are used.

Unless I’m misunderstanding it, I don’t think the observation about the Collections class helper functions isn’t on point. The case here is not optimising the case when we know the size of the collection on construction, it’s as above for the case where we have a zillion collections, most of which are empty and some grow later. I don’t know whether things like ArrayList optimise the empty case initially, or not.

( https://shibboleth.atlassian.net/browse/JSSH-30#add-comment?atlOrigin=eyJpIjoiNmFhMTU0ZDM5NjFlNDAwMTkzZWRiZWRmNDllYTNhNDkiLCJwIjoiaiJ9 ) Add Comment ( https://shibboleth.atlassian.net/browse/JSSH-30#add-comment?atlOrigin=eyJpIjoiNmFhMTU0ZDM5NjFlNDAwMTkzZWRiZWRmNDllYTNhNDkiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100225- sha1:f83bc8f )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20230504/040a4294/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-28ea795e-6d61-4c6e-bb1c-3ac9d724b298
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20230504/040a4294/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-96798016-87c8-410b-9366-bf9e4f9c9046
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20230504/040a4294/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-d178bf55-a118-40f4-b08b-c6059c2fbb5d
Type: image/png
Size: 484 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20230504/040a4294/attachment-0005.png>


More information about the commits mailing list