Improve BitsTypeObject storage

Description

Separate from MDSAL-743, which defines the headline term, let's improve how we storage the individual bits. With MDSAL-744 we promise to provide a boolean value. Most of the bits we encounter have a very limited number of possible bits, let's say there are three classes:

  • up to 32 bits, which should use an 'int' for storage

  • up to 64 bits, which should use a 'long' for storage

  • more than 64 bits, which should use an int[] for storage]

Specialize codegen to recognize these three classes and store the set bits in the appropriate storage class, providing the required methods on bit operations. This will drop storage requirements (when compared to MDSAL-743) by additional factor of 8, providing a 32x/64x improvement when compared to current Boolean storage.

Activity

Show:

Robert Varga November 10, 2022 at 1:52 AM

I think we should do this only after , which will give us a proper structure for what kinds of things we want to generate. Once we have that, we will have a BitsTypeObjectArchetype, which can capture the layout vs. properties difference, thus communicating clearly what needs to be generated and how.

On java-api-generator side this also implies creating a BitsTypeObjectTemplate and pulling bits-related special-cases there.

Robert Varga November 10, 2022 at 1:48 AM

So we are in a bit of a pickle w.r.t. serialization, I think.

serialVersionUID is based on properties, but it really needs to reflect resulting class layout as well to be really accurate.

The problem is that the current patch does not change serial version, even when fields change from individual booleans to ints/whatever.

I am not sure what to about this: I think serialVersionUID needs to capture both the properties and the resulting layout (hence mdsal-binding-generator needs to know about these).

Lets punt this for the next release.

Robert Varga April 11, 2022 at 8:30 PM
Edited

proposes to make similar improvements on yang.data.api level. While mdsal is free to its own thing (because "codegen"!) it would be nice if we could share some of the solution space.

Details

Assignee

Reporter

Labels

Components

Fix versions

Priority

Created April 11, 2022 at 8:22 PM
Updated June 24, 2024 at 8:49 AM
Loading...