|
From: Patrick C. <pat...@gm...> - 2023-06-19 23:46:59
|
How many property subscriptions at most can be serviced in one tenth of a second? On Tue, Jun 13, 2023 at 11:29 AM James Turner <ja...@fl...> wrote: > > > > On 12 Jun 2023, at 20:46, TheFGFSEagle <the...@gm...> wrote: > > > > Oh great, could you explain it a bit, please ? I have no idea how it > could work without storing a pointer to the node ! :mrgreen: > > > > Well, you are right of course, but what I did was replace the simple > pointer to the target node (which was already present in the size of > SGPropertyNode), with a helper struct ‘AliasData’ which contains the target > node and the listener pointer. So I replaced a pointer to one kind of > thing, with a pointer to a slightly more sophisticated thing, no magic. > > This is the same pattern we use for listeners; the first time you add a > listener to a property we allocate an extra struct to store the listeners > and related info, so if you never add a listener at all, we only pay the > cost of the empty pointer. > > In principle there’s a bit more of this kind of thing we could do, to put > SGPropertyNode on a diet, but the disruption to the existing code would be > high, so I’m not super keen on that. > > Kind regards, > James > > > > _______________________________________________ > Flightgear-devel mailing list > Fli...@li... > https://lists.sourceforge.net/lists/listinfo/flightgear-devel > |