Search found 726 matches

by grump
Sun May 16, 2021 4:08 am
Forum: General
Topic: Google failed: how to force explicit variable declaration?
Replies: 4
Views: 83

Re: Google failed: how to force explicit variable declaration?

Tnere are several "strict mode" implementations that do this. Search for "strict.lua".
by grump
Sun May 16, 2021 4:06 am
Forum: Support and Development
Topic: How do I update the positions of instances of meshes?
Replies: 2
Views: 61

Re: How do I update the positions of instances of meshes?

You don't send the positions to the shader directly, you update them by calling instancemesh:setVertexAttribute with the instance number, the attribute index, and the position values.
by grump
Sat May 15, 2021 5:18 pm
Forum: Support and Development
Topic: Garbage going crazy
Replies: 17
Views: 559

Re: Garbage going crazy

pgimeno wrote: Sat May 15, 2021 4:56 pm Isn't it distinguishable by amount of garbage generated, rather than speed?
Maybe, but not necessarily. It keeps accumulating garbage even when it runs sufficiently fast. But I haven't looked at the exact numbers. Garbage is also generated faster as it runs faster.
by grump
Sat May 15, 2021 2:27 pm
Forum: Support and Development
Topic: Garbage going crazy
Replies: 17
Views: 559

Re: Garbage going crazy

Well, this may be a bit (understatement of the year) kludgy, but maybe consider measuring performance and doing love.event.quit("restart") if it's not enough. I have considered doing that, but it seems difficult to distinguish between "this computer is slow" and "LuaJIT doe...
by grump
Sat May 15, 2021 12:49 pm
Forum: Support and Development
Topic: Garbage going crazy
Replies: 17
Views: 559

Re: Garbage going crazy

So... I got the trace log thingie going, and it provided a little insight. There were a bunch of aborted traces with fallbacks to the interpreter, even though there is not a single NYI call in the critical parts. I could eliminate all of these aborts by tweaking JIT options, cranking them up to much...
by grump
Wed May 12, 2021 6:15 pm
Forum: Support and Development
Topic: Garbage going crazy
Replies: 17
Views: 559

Re: Garbage going crazy

In case it helps, here's my package.path (in both Löve and command line luajit): I added the jit system directory to LÖVE's require path and it finds dump.lua. Unfortunately I can't use it like that because the LÖVE AppImage I use has LuaJIT 2.0.4 and my system has 2.1.0 installed. I'm just gonna g...
by grump
Wed May 12, 2021 11:33 am
Forum: Support and Development
Topic: Garbage going crazy
Replies: 17
Views: 559

Re: Garbage going crazy

Oops. Maybe it does for me because I have LuaJIT installed system-wide. Hm, me too. I'll look into it later, thank you. Just to add a little bit more weirdness: local inRange = self.y - y < self.spriteSize if not inRange then return end Speed before adding these two lines: 500+ fps Speed after addi...
by grump
Wed May 12, 2021 12:16 am
Forum: Support and Development
Topic: Garbage going crazy
Replies: 17
Views: 559

Re: Garbage going crazy

Sounds like the "magical" issues i had with FFI myself, with some audio modules i coded that ran with speeds varying like that... doing casting shenanigans between integers and floats with unions... I see it all the time. The more you deviate from standard Lua code, the more it becomes ap...
by grump
Tue May 11, 2021 8:37 pm
Forum: Support and Development
Topic: Garbage going crazy
Replies: 17
Views: 559

Re: Garbage going crazy

Nice fix. It fixed the garbage problem, but there's still huge performance fluctuations between runs. Most of the time it takes a constant 2 ms per update, other times it takes 4-6 ms. Once in a while it only takes .4 ms. It decides how fast it wants to run at every start and sticks to its decision...
by grump
Tue May 11, 2021 4:44 am
Forum: Support and Development
Topic: Garbage going crazy
Replies: 17
Views: 559

Re: Garbage going crazy

Without much analysis, I think what you see is that the short loop (1..10) is stopping the trace. Unrolling it solves the issue. Thanks for checking. I have these two big components in my project that rely heavily on ffi types, and they both perform well on their own. But as soon as both of them ar...