Page 1 of 2

Performance issue: 80% usage of a 3080 12gb? Bruh

Posted: Sun Dec 18, 2022 1:07 pm
by Krauly
What's so wrong with my code?
I have a I9-12900k, RTX3080 12GB, 64GB Ram and sometimes I drop from 240+fps down to 50-60 visually even less cause it starts to stutter.
In the task manager I noticed GPU at 80% usage like wut?

Re: Performance issue: 80% usage of a 3080 12gb? Bruh

Posted: Sun Dec 18, 2022 2:51 pm
by knorke
does not run on my linux, i think in main.lua here:
local button = require 'Button'
it needs to be lower case b

Re: Performance issue: 80% usage of a 3080 12gb? Bruh

Posted: Sun Dec 18, 2022 3:05 pm
by GVovkiv
knorke wrote: Sun Dec 18, 2022 2:51 pm does not run on my linux, i think in main.lua here:
local button = require 'Button'
it needs to be lower case b
There several naming problems, like this. I guess op is working on windows, so they doesn't affected by that.
Here, with fixed naming:

Re: Performance issue: 80% usage of a 3080 12gb? Bruh

Posted: Mon Dec 19, 2022 3:32 pm
by Krauly
I think I fixed the namings, can you run it now?

Re: Performance issue: 80% usage of a 3080 12gb? Bruh

Posted: Mon Dec 19, 2022 3:33 pm
by GVovkiv
Krauly wrote: Mon Dec 19, 2022 3:32 pm I think I fixed the namings, can you run it now?
now there is no file to run

Re: Performance issue: 80% usage of a 3080 12gb? Bruh

Posted: Mon Dec 19, 2022 3:40 pm
by Krauly
GVovkiv wrote: Mon Dec 19, 2022 3:33 pm
Krauly wrote: Mon Dec 19, 2022 3:32 pm I think I fixed the namings, can you run it now?
now there is no file to run
Let me send you the zip instead of the .love, dunno why it wont run if I .love it

Re: Performance issue: 80% usage of a 3080 12gb? Bruh

Posted: Mon Dec 19, 2022 3:45 pm
by GVovkiv
First, you still trying in code to load image as "IMG/BackgroundFinish.png"(gui.lua:33) while file is "IMG/backgroundFinish.PNG"
2nd, it seems, that somewhere happens memory leak. Every time i collect diamond, memory usage does up and up.
Actually no, ram usage go up no matter what i do

Re: Performance issue: 80% usage of a 3080 12gb? Bruh

Posted: Mon Dec 19, 2022 3:46 pm
by BrotSagtMist
Youre still having naming problems.

Anyway, its quite clear what happens: Diamond.updateAll(dt) is what causes an insta freeze.
I think you are trying to apply physics to non movable objects here, eh?

Edit: I didnt even spot the memory leak, but yea it goes up uncontrollably. Not related to the diamonds, i think you are reloading assets each frame.

Re: Performance issue: 80% usage of a 3080 12gb? Bruh

Posted: Mon Dec 19, 2022 3:55 pm
by Krauly
BrotSagtMist wrote: Mon Dec 19, 2022 3:46 pm Youre still having naming problems.

Anyway, its quite clear what happens: Diamond.updateAll(dt) is what causes an insta freeze.
I think you are trying to apply physics to non movable objects here, eh?
I need physics in order to get a hitbox, so when player collides with a diamond it calls the fucntion to:
add +1 to diamonds collected
destroys the hitbox
and removes it from the table that gets drawn

Re: Performance issue: 80% usage of a 3080 12gb? Bruh

Posted: Mon Dec 19, 2022 4:04 pm
by BrotSagtMist
No you dont, you dont need physics on not movable objects, they do not interact with the world, the player interacts with them.
In short you should not need to update these ever.

As for memory, as i thought: line 53 in player.lua
You are telling it to shove this picture into ram each frame. Like this game constantly just gobbles copies of that picture into it.
You need to change the reference, not reload it:

Code: Select all

A={}
A.L=load("L.png")
A.R=load("R.png")
draw(A[direction])