Comments (2)
Refinement: we don't need to use raw pointers or extra data for history links. If each page gets a serial number and is (for instance) 1024 history items long, then we can link to it with a usize, using the bottom 10 bits for the position within the page, and the rest of the bits for the serial number. First look up the page number in the TimeSteward, then look up the individual item in the page.
from time-steward.
We can't really do the same thing for events. Discarding history worked because history only goes up to the present time. But we create events in the future. So pages might have far-future events on them, preventing them from getting deleted.
If that can be worked around somehow, we can do the same thing for events, making EventHandle a glorified usize.
Pros:
- no need for reference counting of events (reduced time cost and memory cost)
- obsolete events can be freed while there are still links to them (reduced memory cost)
- much simpler allocation of events (reduced time cost, and probably an improvement in memory usage as well because of fragmentation)
Cons:
- dereferencing an event handle is slightly more expensive in time
- dereferencing an event handle can fail inconsistently (this would be a pro if it was guaranteed to fail for events before the forget-before time, but that won't be guaranteed, at least not without a time cost)
Seems clearly advantageous if dereferencing events isn't very common. When do we dereference events?
- In order to sort future events and know what's coming next (log n per event, but we might use something like a radix trie for that, which would remove this case)
- When an event actually comes up to be executed (assumption: no more than approximately once per event)
- When going back in history (assumption: much less than once per event)
- When client could does it explicitly (none of my example simulations have done this yet)
from time-steward.
Related Issues (20)
- Standardize using ExtendedTime rather than base time in all API functions HOT 2
- Rethink valid_since() and forget_before() API HOT 3
- For the types that can only be dereferenced using a TimeSteward, is there any 0-cost way we can provide safety against using the WRONG TimeSteward object?
- Use a faster hash algorithm? HOT 1
- Implement Rand for DeterministicRandomId HOT 1
- Support upper time limits for step()
- Put the "rowless" code at the top level, since it's almost as complete as the old code
- Tracking issue for current very-disruptive API changes HOT 1
- Figure out what I really mean by StewardData [duplicate] HOT 1
- Figure out what I really mean by StewardData HOT 3
- Make better manual Debug impls
- Modification protocol HOT 1
- When generic associated types become available… HOT 1
- Single-threaded incremental serialization?
- Implement Div<i64> and variants for Range
- Make Predictions have an independent existence
- Make a robust collection of trajectory types
- Make undo implementations implicit
- Rename Basics HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from time-steward.