Comments (9)
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.
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.
Just Stream::merge
and Cell::switchC
to go before we are coalesce-free.
from sodium-typescript.
Great! I'll have to look at making these changes to the .NET versions as well.
from sodium-typescript.
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.
coalesce-free Cell::switchC
: https://gist.github.com/clinuxrulz/9f1bf3eafb38085517cb96d67522a84b
we can now live without seq
in Entry
.
from sodium-typescript.
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.
Actually not confident in the switchC solution yet, will need to double check.
from sodium-typescript.
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)
- Memory bounce in switchC/switchS HOT 2
- Nicer crash recovery
- Cell::liftArray optimization HOT 1
- Add sodium.Transaction.post() ?
- restrict "send() was invoked before listeners were registered" to sinks?
- Seems npm does have postinstall scripts. HOT 2
- collectCycles() is being called many times in a single transaction (Performance issue) HOT 2
- include Cell.calm / Cell.partialCalm / Cell.calmRefEq / ... ? HOT 2
- Should Operational.updates() keep its inner cell alive for the lifetime of the result? HOT 2
- Priority queue re-sorts happens too often [Performance] HOT 7
- Verifying integrity of Vertex graph HOT 2
- The rank feels wrong HOT 25
- Timer.spec.ts test has a vertex/node cycle in it.
- Port C++ router to typescript HOT 5
- missing handy methods
- Cell::setStream performance HOT 7
- TimerSystem can be improved
- Possible rank optimization
- TypeError: Cannot read property 'requestRegen' of null HOT 5
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 sodium-typescript.