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

Feature/1728/on demand rendering #1806

Merged
merged 19 commits into from
Mar 5, 2021
Merged

Conversation

Med-H
Copy link
Contributor

@Med-H Med-H commented Feb 22, 2021

ondemand rendering

Issue: #1728

Description

Descriptive pull request text, answering:

  • With this PR the gpu utilization will be near 0% when in idle mode
  • The render request animation has been removed in favor of manual update when needed

Screenshots or gifs

without gpu on demand
image

with gpu on demand
image

@BridgeAR
Copy link
Member

Seems like the prettier check does not check the exit code properly. Some files have the different line ending again :)

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly LGTM. It does feel like we could easily miss something though and we have to be very careful to really rerender everything properly. Thus, I would like to have others closely review this, especially by trying it out in all kinds of situations.

Going forward is also more difficult with this solution as we have to pay attention to call update manually. It would be good to rework the internals in a way that this is all done for us automatically.

@@ -99,6 +99,8 @@ export class CodeMapPreRenderService
) {
this.debounceRendering()
this.debounceTracking(actionType)
} else {
this.codeMapRenderService.update()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this update really be called here? I would expect it to be triggered identical to this.debounceRendering() from the debounce time and never cause any update otherwise?

Copy link
Contributor Author

@Med-H Med-H Feb 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think debouncerendering does set a new map mesh etc, while this.codeMapRenderService.update() is only re drawing the frame.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But do we need to redraw anything in case there's no update to the map? Why would we trigger the function otherwise?

Copy link
Collaborator

@ce-bo ce-bo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I had not the time to test it locally.

@ce-bo
Copy link
Collaborator

ce-bo commented Mar 5, 2021

I tested it locally and it works :)

Comment on lines +102 to +117
const sharpnessTests = [
{ func: "stopAnimate" },
{ func: "destroy" },
{ func: "autoFitTo" },
{ func: "animate" },
{ func: "animateStats" }
]
beforeEach(() => {
codeMapController.onSharpnessModeChanged()
})

for (const test of sharpnessTests) {
it(`should call threeViewerService ${test.func}`, () => {
expect(threeViewerService[`${test.func}`]).toHaveBeenCalled()
})
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally would have used a single it and used a for loop inside that, but that's just my personal style and not blocking.

@sonarcloud
Copy link

sonarcloud bot commented Mar 5, 2021

[CodeCharta Analysis] Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@sonarcloud
Copy link

sonarcloud bot commented Mar 5, 2021

[CodeCharta Visualization] Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

98.0% 98.0% Coverage
0.0% 0.0% Duplication

@BridgeAR BridgeAR merged commit 03a4e2d into main Mar 5, 2021
@BridgeAR BridgeAR deleted the feature/1728/on-demand-rendering branch March 5, 2021 10:07
@BridgeAR BridgeAR mentioned this pull request Aug 5, 2022
4 tasks
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

Successfully merging this pull request may close these issues.

None yet

3 participants