Strange situation.
Writing a game using love2d and 3dreamengine.
90+ fps.
Adding a simple class (no drawing, no update inside, inheritanced from other simple class) — 25 fps…
Removing any string like cClass = require class gives higher fps again.
Looks like there is some limit.
The only suspicious thing — plus pare percents of CPU usage (96 to 98 —100, last drop?).
Memory is ok, video-memory is ok too.
The question. Does anyone know something about the situation?
Is there any known ways for optimizing this?
Performance and quantity of classes
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Performance and quantity of classes
One class and 4 classes inherited from it: 25 fps. One big class, sum of all 5 — 60 with vsync.
-
- Party member
- Posts: 559
- Joined: Wed Oct 05, 2016 11:53 am
Re: Performance and quantity of classes
Can you share example code or .love that demonstrates the framedrops?
Going off of this information alone doesn't give much to work with, I'm afraid.
Going off of this information alone doesn't give much to work with, I'm afraid.
Re: Performance and quantity of classes
>Can you share example code
Well, 1.5 Mb of my code, 3 Mb of third party libs, 125 Mb total.
Can build a light weight demo with the same code structure, but not sure if it'll get the same performance issue. I should think how to do it in better way…
Well, 1.5 Mb of my code, 3 Mb of third party libs, 125 Mb total.
Can build a light weight demo with the same code structure, but not sure if it'll get the same performance issue. I should think how to do it in better way…
Re: Performance and quantity of classes
By the given info I suggest that problem is inside "inheritance" mechanism. Lua does not have embedded one, and there is some different technics to implement that. Can you share code about how you implement inheritance? Maybe it contains some copying, maybe it happens every frame by some mistake. Lua does not care about "classes" only about "tables", so if you add one table that designed to be new class — that is only human interpretation, lua does not know about it.
99% CPU usage is also strange. Modern CPU rarely contains 2 or 1 cores (Is that a case?) But with 4 or more cores it is really hard to effectively keep them busy with love. And that by itself can point to some mistake.
99% CPU usage is also strange. Modern CPU rarely contains 2 or 1 cores (Is that a case?) But with 4 or more cores it is really hard to effectively keep them busy with love. And that by itself can point to some mistake.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 5 guests