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

Avoid calling into AnalysisManager within per-pixel loop #29

Closed
philipbelesky opened this issue Sep 12, 2019 · 0 comments
Closed

Avoid calling into AnalysisManager within per-pixel loop #29

philipbelesky opened this issue Sep 12, 2019 · 0 comments
Assignees
Labels
speed up Making things faster

Comments

@philipbelesky
Copy link
Collaborator

Calling into the AnalysisManager to get lookup pixel colors is significantly slower (across the loop's course) than the previous method which had a direct lookup of a color table which was local to SolveInstance(). Ideas for improving performance here while keeping the abstractions from the analysis classes:

  • Extracting the relevant lookup tables into a local variable before entering the loop
  • Setting the relevant GetPixelColor for each analysis type as a delegate method before entering the loop

I'm not very clear as to the relative low-level performance differences between different options here so will play around and see what works best. As we are dealing with pretty small differences in time I might try and make some mock functions that can simulate the process of coloring the per-pixel loop in a way that can be more easily run multiple times and averaged. I had a go at using benchmark do net for this, but didn't have any luck integrating it as either a console app (which then couldn't call into rhino common) or as a separate plugin (which then couldn't instrument methods within SolveInstance). Maybe the dotTrace profiler will help.

@philipbelesky philipbelesky added the speed up Making things faster label Sep 12, 2019
@philipbelesky philipbelesky self-assigned this Sep 12, 2019
philipbelesky added a commit to philipbelesky/SandWorm that referenced this issue Sep 20, 2019
…loses mariuszhermansdorfer#29

This includes earlier optimisations that were not present (e.g. the color table as a dictionary) and reworks the way analysis is applied so that mariuszhermansdorfer#33 can be implemented. Future tweaks will be benchmarked and sent in PRs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
speed up Making things faster
Projects
None yet
Development

No branches or pull requests

1 participant