When you say that 'Accessing to an xrecord in the extension dictionary of a DBObject is not as trivial as accessing to its xdata', is there any downside in your view regarding performance, or is it just a matter of ease of use of xdata?IMHO, it is not a question of performance. To read or write xrecord data, you need more code (i.e. the extension methods).
From my understanding, xdata’s size is limited, but has a feature that xrecords don’t, in that some items are transformed with the entity (if it’s an entity)
Xrecord’s size isn’t limited .
Performance you will have to measure, there is a cost for opening objects, but in an overrule context, you already have the DbObject opened.
so xdata may win
ResultBuffer is a huge class.
If you don’t need the overrule filter to be persisted and performance is an issue it would be much much faster to have a dictionary {objectid : filterdata}
IMHO, it is not a question of performance. To read or write xrecord data, you need more code (i.e. the extension methods).
From my understanding, xdata’s size is limited, but has a feature that xrecords don’t, in that some items are transformed with the entity (if it’s an entity)
Performance you will have to measure, there is a cost for opening objects, but in an overrule context, you already have the DbObject opened.
so xdata may win
ResultBuffer is a huge class.
If you don’t need the overrule filter to be persisted and performance is an issue it would be much much faster to have a dictionary {objectid : filterdata}
Yeah, and handling ResultBuffers is hard work!
With XRecords I usually use a test string in a csv style key:value pair or xml/json for more complex data that I need to put into an object anyway for processing.
Did I understand wrong or do you use a single entry in the extension dictionary to insert several text-type data in json format?
Yes, I usually just store a single string entry in the result buffer. JSON and XML are just long strings and C# has powerful parsers and serialisation tools which makes it easy to work with them.
On the occasion where your string data is very large (it happens easily with xml) you can 'minify' the xml/json data and also use Daniel's StringToResultBuffer code linked below to compress the data even further.
https://www.theswamp.org/index.php?topic=27010.msg325377#msg325377
I am currently preparing an example to try to stress the Overrule methods in an attempt to discover their limits and also acquire knowledge.
As soon as I finish the code, I will post it here.
From my understanding, xdata’s size is limited, but has a feature that xrecords don’t, in that some items are transformed with the entity (if it’s an entity)
Xrecord’s size isn’t limited .
Performance you will have to measure, there is a cost for opening objects, but in an overrule context, you already have the DbObject opened.
so xdata may win
ResultBuffer is a huge class.
If you don’t need the overrule filter to be persisted and performance is an issue it would be much much faster to have a dictionary {objectid : filterdata}
...
Sorry to say but XRecord size is limited.
...
From my understanding, xdata’s size is limited, but has a feature that xrecords don’t, in that some items are transformed with the entity (if it’s an entity)
Before [(1001, 'MYXD'),
(1011, <PyGe.Point3d(0.00000000000000,0.00000000000000,0.00000000000000)>),
(1013, <PyGe.Point3d(1.00000000000000,0.00000000000000,0.00000000000000)>),
(1013, <PyGe.Point3d(0.00000000000000,1.00000000000000,0.00000000000000)>),
(1013, <PyGe.Point3d(0.00000000000000,0.00000000000000,1.00000000000000)>)]
After [(1001, 'MYXD'),
(1011, <PyGe.Point3d(100.00000000000000,100.00000000000000,100.00000000000000)>),
(1013, <PyGe.Point3d(0.00000000000000,0.00000000000000,1.00000000000000)>),
(1013, <PyGe.Point3d(1.00000000000000,0.00000000000000,0.00000000000000)>),
(1013, <PyGe.Point3d(0.00000000000000,1.00000000000000,0.00000000000000)>)]
[(1001, 'MYXD'),
(1011, <PyGe.Point3d(0.00000000000000,0.00000000000000,0.00000000000000)>),
(1013, <PyGe.Vector3d(1.00000000000000,0.00000000000000,0.00000000000000)>),
(1013, <PyGe.Vector3d(0.00000000000000,1.00000000000000,0.00000000000000)>),
(1013, <PyGe.Vector3d(0.00000000000000,0.00000000000000,1.00000000000000)>),
(1012, <PyGe.Vector3d(1.00000000000000,0.00000000000000,0.00000000000000)>),
(1012, <PyGe.Vector3d(0.00000000000000,1.00000000000000,0.00000000000000)>),
(1012, <PyGe.Vector3d(0.00000000000000,0.00000000000000,1.00000000000000)>)]
After [(1001, 'MYXD'),
(1011, <PyGe.Point3d(100.00000000000000,100.00000000000000,100.00000000000000)>),
(1013, <PyGe.Vector3d(0.00000000000000,0.00000000000000,1.00000000000000)>),
(1013, <PyGe.Vector3d(1.00000000000000,0.00000000000000,0.00000000000000)>),
(1013, <PyGe.Vector3d(0.00000000000000,1.00000000000000,0.00000000000000)>),
(1012, <PyGe.Vector3d(0.00000000000000,0.00000000000000,2.00000000000000)>),
(1012, <PyGe.Vector3d(2.00000000000000,0.00000000000000,0.00000000000000)>),
(1012, <PyGe.Vector3d(0.00000000000000,2.00000000000000,0.00000000000000)>)]