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

O(1) damage map #189

Closed
dankamongmen opened this issue Dec 21, 2019 · 5 comments
Closed

O(1) damage map #189

dankamongmen opened this issue Dec 21, 2019 · 5 comments
Assignees
Labels
enhancement New feature or request perf sweet sweet perf
Milestone

Comments

@dankamongmen
Copy link
Owner

Our per-line damage map is pretty decent. Not bad. We can do better, and at the same time implement notcurses_at_yx() (very useful for testing). Maintain a copy of the rendered scene as cells rather than a memstream. This is described in the comments on #150 .

With this, we get damage detection at the highest possible resolution, with no need for active engagement. Ought be a big win, certainly in terms of robustness/complexity.

I don't think we should release 1.0.0 without this.

@dankamongmen dankamongmen added this to the v1.0.0 milestone Dec 21, 2019
@dankamongmen dankamongmen added enhancement New feature or request perf sweet sweet perf labels Dec 21, 2019
@dankamongmen dankamongmen self-assigned this Dec 21, 2019
@dankamongmen
Copy link
Owner Author

When this is done, O(1) notcurses_at_yx() is trivially implemented. notcurses_refresh() becomes slightly more complex, but it's just a marshaling of the stored render (as opposed to the current dump of the retained memstream).

@dankamongmen
Copy link
Owner Author

Note that this still has to do all of the actual output computation, and only saves work by eliding the output (mostly saving terminal emulator work). We still ought pursue a method allowing us to elide the former, likely in conjunction with this approach.

@dankamongmen
Copy link
Owner Author

got this working except for some misses on wide characters. should be done shortly.

@dankamongmen
Copy link
Owner Author

got it!

dankamongmen added a commit that referenced this issue Dec 22, 2019
* notcurses: set up lastframe #189
* render: o(1) take no prisoners damage detection #189
@dankamongmen
Copy link
Owner Author

20% reduction in emitted data, sweeeeeet

dankamongmen added a commit that referenced this issue Dec 22, 2019
* notcurses: set up lastframe #189
* render: o(1) take no prisoners damage detection
* EAAAAAAAAAAGLES
* slight background on intro
* 0.9.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request perf sweet sweet perf
Projects
None yet
Development

No branches or pull requests

1 participant