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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Krauly
Prole
Posts: 12
Joined: Thu Dec 08, 2022 6:12 pm

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

Post 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?
Attachments
CS50's SpeedRunner.love
Updated again, no be mad me monkey plz
(19.86 MiB) Downloaded 74 times
Last edited by Krauly on Mon Dec 19, 2022 4:06 pm, edited 3 times in total.
User avatar
knorke
Party member
Posts: 274
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

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

Post 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
User avatar
GVovkiv
Party member
Posts: 686
Joined: Fri Jan 15, 2021 7:29 am

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

Post 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:
Attachments
CS50's SpeedRunner_.love
(3.28 MiB) Downloaded 72 times
Krauly
Prole
Posts: 12
Joined: Thu Dec 08, 2022 6:12 pm

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

Post by Krauly »

I think I fixed the namings, can you run it now?
Last edited by Krauly on Mon Dec 19, 2022 3:37 pm, edited 1 time in total.
User avatar
GVovkiv
Party member
Posts: 686
Joined: Fri Jan 15, 2021 7:29 am

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

Post 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
Krauly
Prole
Posts: 12
Joined: Thu Dec 08, 2022 6:12 pm

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

Post 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
Attachments
CS50's SpeedRunner.7z
here
(19.86 MiB) Downloaded 75 times
User avatar
GVovkiv
Party member
Posts: 686
Joined: Fri Jan 15, 2021 7:29 am

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

Post 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
Last edited by GVovkiv on Mon Dec 19, 2022 3:48 pm, edited 1 time in total.
User avatar
BrotSagtMist
Party member
Posts: 659
Joined: Fri Aug 06, 2021 10:30 pm

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

Post 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.
obey
Krauly
Prole
Posts: 12
Joined: Thu Dec 08, 2022 6:12 pm

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

Post 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
User avatar
BrotSagtMist
Party member
Posts: 659
Joined: Fri Aug 06, 2021 10:30 pm

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

Post 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])
obey
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests