Coder Social home page Coder Social logo

Comments (9)

clinuxrulz avatar clinuxrulz commented on June 10, 2024 1

Here is one possible coalesce-free solution that will cause the lambda in the example above to be just evaluated twice:
https://gist.github.com/clinuxrulz/1bd47cda980cc256bd012506af268e54

It should be possible to eliminate Stream::coalesce_() from everything and thus remove the requirement of seq in Entry. It would allow everything with the same rank to be updated in parallel with threads or web-workers (if we want to). And it would decrease the size of the priority queue to the number of unique ranks being fired at once. (Each element of the priority queue being a list of entries of same rank.)

from sodium-typescript.

jam40jeff avatar jam40jeff commented on June 10, 2024

This may cut down the number of times f can be called to be 2, but wouldn't it cause the next downstream listener to potentially see 2 values (and thus an intermediate value) since out is no longer coalesced?

EDIT: Never mind, I see that out.Send is properly prioritized (and prioritize will only be called once because of the pumping variable). This looks like a good optimization! Thanks.

from sodium-typescript.

clinuxrulz avatar clinuxrulz commented on June 10, 2024

Just Stream::merge and Cell::switchC to go before we are coalesce-free.

from sodium-typescript.

jam40jeff avatar jam40jeff commented on June 10, 2024

Great! I'll have to look at making these changes to the .NET versions as well.

from sodium-typescript.

clinuxrulz avatar clinuxrulz commented on June 10, 2024

coalesce-free Stream::merge: https://gist.github.com/clinuxrulz/a06eba0d727a372b0016d19783f067fc

Its pretty much the same solution used for Cell::apply

Cell::switchC will need a little more thought.

from sodium-typescript.

clinuxrulz avatar clinuxrulz commented on June 10, 2024

coalesce-free Cell::switchC: https://gist.github.com/clinuxrulz/9f1bf3eafb38085517cb96d67522a84b

we can now live without seq in Entry.

from sodium-typescript.

clinuxrulz avatar clinuxrulz commented on June 10, 2024

I have an experimental branch that never resorts the priority queue with all tests passing. Not sure what the performance is like compared to the original though, so I will not PR until I've done more testing.

https://github.com/clinuxrulz/sodium-typescript/tree/priority-queue

from sodium-typescript.

clinuxrulz avatar clinuxrulz commented on June 10, 2024

Actually not confident in the switchC solution yet, will need to double check.

from sodium-typescript.

clinuxrulz avatar clinuxrulz commented on June 10, 2024

switchC all good now, found a missing pump() when debugging by doing random sort of entries of same rank.

from sodium-typescript.

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.