Performance issue on production Build

I made a production build with a scene, then made a simple server with express.js for uploading the project, but when run locally and open it in a browser the performance is significantly reduced, I’m talking about maybe 2 to 6 frames per second.
On console this message is printed exactly 4 times both on Firefox and Chrome.
This is the code I’m using:
server.js

const express = require('express');
const path = require('path');

const app = express();
const port = 3000;

app.use(express.static(path.join(__dirname, 'dist')));

app.get('/', (req, res) => {
    res.sendFile(path.join(__dirname, 'index.html'));
});

app.listen(port, () => {
  console.log(`Running here: http://localhost:${port}`);
});

image.png

Original Post on Discord

by user 368204675922657280

Hey :wave: any more info, unity version, needle version?

Unity version 2022.3.4f1 and Needle Engine 3.10.3-pre.
Ill update it and check again if it still happends

by user 368204675922657280

Yes it still happends. Inside Firefox there is a warning about textures, and looks like it struggles to create the webGLContext at begining

by user 368204675922657280

Inside Chrome the same message about “Read pixels” appears the first time i load the project, after reload it desapears, but performance is still very poor. Could be a Texture problem?

by user 368204675922657280

Yeap, i closed chrome and reopen it, and the messages appear again:
image.png

by user 368204675922657280

Also as i said previously, i updated to latest version: Needle Engine 3.10.5-pre

by user 368204675922657280

Just to verify that it is tied to the server somehow, could you please deploy to glitch and confirm that the performance hit is not present there?

Also confirm your FPS by adding ?stats to the url if you haven’t before. (i know SUPER slow is still SUPER Slow, but just you know… the performance could differ)

yes ill try it… give me a moment

by user 368204675922657280

I’ve just made a production build on 2020 and re-deployed the Configurator sample. (https://engine.needle.tools/samples/configurator/?stats) performance seems ok (50 fps, since the target fps is 60fps- currently known issue)

Maybe… for some odd reason… try setting the target fps to something high, like 150. Open dev console and write Needle.Context.Current.targetFrameRate = 150

I’ll try to deploy from 2022.

Sample deployed from 2022 has the same performance as one from 2020.
https://engine.needle.tools/samples/configurator/?stats

So, it is caused by the content or by the server. Where i feel the server shouldn’t cause WebGL warns.

Can you describe what is your app about and what feautres do you use?

Yes it also happends on glitch:
I think theres something wrong in my project, i suspect that textures might be the problem

by user 368204675922657280

What do you get when you visit this site on your device?
image.png

Since what the error says is that webgl2 is probably not enabled? :eyes: And that is definitely wrong. Only super old devices do have only webgl1 support. Did you disabled it by accident via some extension?
EDIT ^^^

sorry, should had catched that right from the beginning.

Whait thats very weird! on mobile it works just fine

by user 368204675922657280

but if you open it in desktop, it has all the previous thing

by user 368204675922657280

Can you try opening it in an anonymous window? (potentially without extensions)

yeah ill try that

by user 368204675922657280