Skip to content

Replace ares.cpp serialization logic with a custom graph traversal pass #25

@HaroldCindy

Description

@HaroldCindy

At a high level, Ares is relatively simple. It has logic to walk the graph of references from the starting object, depth-first. It keeps track of nodes as it goes, filling in a reference to a previous object if it ever sees it referenced from another node.

Pretty typical graph traversal stuff, but the graph traversal logic is all mushed in with the object (de)serialization logic because Eris (and therefore Ares) manages traversal state using Lua APIs. That results in a lot of garbage related to traversal state being handed off to the GC, which I expect could result in extreme GC pressure on startup when lots of scripts are spinning back up.

I think the format itself makes sense, but the graph traversal logic should just be in C++ so we don't create tons of Lua objects that we won't need after Ares has run. Not to mention that stack imbalances with the traversal logic are verify difficult to debug currently.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions