[YANGTOOLS-1001] Reconsider AbstractPathArgument hashCode() Created: 30/May/19  Updated: 10/Apr/22  Resolved: 03/Sep/19

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: 2.1.11, 3.0.2

Type: Improvement Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Single-byte hashCodeGuard has not-so-nice effects in NodeWithValue and NodeIdentifierWithPredicates, causing them to have 7 bytes worth of padding per instance. Even NodeIdentifier has a 3/7 byte padding.

Eliminating hashCodeGuard in favor of treating hashCode == 0 as not present will have the effect of eliminating most of the padding:

NodeIdentifier goes from 24/32 bytes to 24 bytes, saving 8 bytes in the 64bit case.

NodeWithValue and NodeIdentifierWithPredicates go from 32/40 bytes to 24/32 bytes, saving 8 bytes for every case.

 



 Comments   
Comment by Robert Varga [ 03/Sep/19 ]

https://git.opendaylight.org/gerrit/#/q/Ia444cf708f5209cb22f2661e48f2f2ffaf150281

Generated at Wed Feb 07 20:54:54 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.