SailorWebFramework / Sailor

Frontend Swift web framework
Apache License 2.0
16 stars 0 forks source link

Memory Efficient and Fast UniqueID Generator #18

Open JoshSweaterGuy opened 2 months ago

JoshSweaterGuy commented 2 months ago

Problem

Currently stateIDs and sailboatIDs are generated using 2 separate uint32 variable. however consider making one central UniqueID generator with a more complex and scalable architecture.

Current Solution

The current algorithm is when a new ID is requested by a component it adds 1 to a counter and returns that number as the new ID. This might be the best solution, however is the application is complex and involves a lot of states and dom items being added this ID will quickly become a very large number. This could lead to bugs with integer overflow.

Dependencies

This Issue also would involve modifications to Sailboat and the UniqueID generator core should be added to Sailboat with an interface for it in Sailor.

JoshSweaterGuy commented 1 month ago

Progress: Keeping the same ID method but going to create one central object with a 64 bit ID.