Suggestion for Possible performance enhancement

All Union Platform questions, comments, feature requests, and bug reports.

Suggestion for Possible performance enhancement

Postby toby » Mon 17 Jun 2013 14:26

I reuse my rooms rather than letting them die and then re-creating them
(seems to reduce memory consumption).

At the time of reuse, I set something like 8-10 attributes, establishing the new room parameters.

After each attribute is set, all my clients (who are all observing all rooms) are notified by one by one.

So if there are 20 clients and 8 attributes, this results in 160
S2C_ROOM_ATTR_UPDATE messages flying around, just to
pick some small numbers out of the air. On a bigger system,
it would be much more.

Having observed that, I changed my code so that it checks if the
value is actually different from what it was before (sometimes it is,
sometimes it isn't), and don't bother 'setting' it to the same value it was before.

But that only solves maybe half the problem.

So here is my suggestion:

- have a way of doing this in bulk, i.e. in addition to
object.setAttribute (parameters)
have
object.setABunchofAttributes( array of parameters )

and then batch the client notifications in some way.

I'm not sure how that would work on the client end,
if it would complicate things there too much, but it seems like
a not-too-uncommon scenario to update several attributes together,
and that making that more efficient would be desirable.

UPDATE:
I just did it myself, by making a combined attribute out of several.
Instead of
attribute1 = value, attribute2 = value, etc
I just have
allthoseattributes = value1/value2/value3/... etc
This works well when they are all being set, and used, together,
and would be less useful in a situation where they are more independent.
toby
 
Posts: 162
Joined: Sun 24 Jun 2012 14:18

Return to Union Platform

Online

Users browsing this forum: No registered users and 3 guests