Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add render helpers #88

Open
DisposaBoy opened this issue Nov 23, 2018 · 0 comments
Open

Add render helpers #88

DisposaBoy opened this issue Nov 23, 2018 · 0 comments

Comments

@DisposaBoy
Copy link
Contributor

For reducers that update the status bar or hud, it'd be nice if there were methods that they could implement that simply returned the relevant data.

The main motivator is to optimize things when we send multiple actions from the client. e.g. when typing we can send ViewPosChanged,ViewModified, QueryCompletions (QC). The first 2 are queued and then picked up by the ui blocking QC.

  1. The reducers are called for every action, so in the case of things like the issues reducer, the status is computed 3 times. We can't always pre-compute the data because it might depend on the current state, and so if it takes more than a few milliseconds, it quickly adds up. In the case of the issues, I recently found a bottleneck where the computation took ~90ms, which multiplied by 3 meant the request took ~270ms on top of actual work.

  2. It'd be better if QC would go first so other actions don't block it

  3. We already know which action's ui updates will get discarded so it'd be nice if reducers didn't have to do anything in these cases.

This would also simplify things because the reducer no longer needs to make sure they always update the state even if they return early.

DisposaBoy added a commit to DisposaBoy/margo that referenced this issue Dec 14, 2019
DisposaBoy added a commit that referenced this issue Dec 14, 2019
* update deps

* make mg.Issue usable as errors

* add support for MARGO_NO_RESTART env var and `//margo:no-restart` comment

* add mgutil.AtomicInt

* add prodile node for kimporter.parseDir

* change profile tree indentation to 2 space

* expose all reduction actions via Ctx.Acts

relevant: #88

* fix compilation error on Windows

* remove travis config, it's been replaced with a GH action

* Temporarily™ disable some tests on Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant