GithubHelp home page GithubHelp logo

Comments (2)

elidupree avatar elidupree commented on July 2, 2024

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.

elidupree avatar elidupree commented on July 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.