GithubHelp home page GithubHelp logo

Comments (10)

mithrendal avatar mithrendal commented on July 22, 2024

this article is about the performance impact of javascript console logging which is used extensively by vAmigaWeb

https://stackoverflow.com/questions/11426185/will-console-log-reduce-javascript-execution-performance

it reads scaring 😱... @chris70c was so right about it ... what a drama if true ... but see yourself


  • when the browser console is closed, calling console.log is about 10 000 times slower than calling an empty function

  • when the console is open, calling it is as much as 100 000 times slower._


maybe its time to disable logging completely (i.e. no logoutput at all in the javascript console)...

when logging console is not loaded

image

and we can enable logging to console when the switch is enabled....

image

@Vweber73 this could also reduce or eliminate timing issues when our devices are under pressure i.e. when overclocking an 68030 to 28Mhz

from vamigaweb.

Vweber73 avatar Vweber73 commented on July 22, 2024

Great finding!
So i understand that the "show console" switch, when set to off, only stopped showing the console, but not the logging itself? Maybe the behaviour of this switch should just be altered so that nothing is logged at all when set to off?

from vamigaweb.

mithrendal avatar mithrendal commented on July 22, 2024

So i understand that the "show console" switch, when set to off, only stopped showing the console, but not the logging itself?

correct thats how it currently works, and that is where the article says 10000 slower than empty function ...

I just cannot understand why it is that expensive ? That is a crazy high multiplier ... unbelievable

Maybe the behaviour of this switch should just be altered so that nothing is logged at all when set to off?

yes. I saw for example while disk loading activity we log all the motor step events ... hundreds of them... we don't need it when playing a game right ? Only when we want to look at it for debugging purposes then we enable it in the settings...

from vamigaweb.

Vweber73 avatar Vweber73 commented on July 22, 2024

Well then let's not log anything unless the switch is on!

from vamigaweb.

mithrendal avatar mithrendal commented on July 22, 2024

pushed to uat

flooding stops when switch is off... although I left some logs in the code, now the log will not constantly grow now when switch is off

to be honest I saw not so much of a massive improvement on my old macbook pro from 2007

therefore I did for testing reverted also TPP=2 back to TPP=1, which makes the ECS super hires mode a bit blurry... but for games this mode is quite useless and with TPP=1 the emulator only has to generate half of the pixels compared to TPP=2

from vamigaweb.

Vweber73 avatar Vweber73 commented on July 22, 2024

Thanks!

I tried this one with Settlers.

The TPP2 effect might be greater than the logging effect... When still logging, now I have no frame drop until 43Mhz included (but I still have glitches here and there). The drops starts at 57Mhz. When I remove the logging, basically from what I can ear, the problem is shifted to the 85Mhz bar, 57Mhz still sounds reasonably ok...

This TPP2 thing is ennoying, especially because it seems there is no way to trigger it only in super hires mode, it is either you have it or you don't, right?

Cheers

from vamigaweb.

dirkwhoffmann avatar dirkwhoffmann commented on July 22, 2024

it is either you have it or you don't, right?

Yes, it's a compile time option. Otherwise, it would take too much computation time (the code had to be flooded with lots of if (TPP == xxx) { do this } else { do that }.

from vamigaweb.

Vweber73 avatar Vweber73 commented on July 22, 2024

Hum, go it, thanks. Maybe 2 versions then, one "serious ECS work" one and one "pure gaming" one, with a hotswapping between the 2?

from vamigaweb.

Vweber73 avatar Vweber73 commented on July 22, 2024

Interesting finding in favour of the performance of vAmigaWeb compared to Retroarch / Puae.

When using 68030 and selecting max map size (8), in Settlers, the game enters a computation phase with a red progress bar. VAmigaWeb does this right, but Puae struggles, the music is screwed up...

from vamigaweb.

mithrendal avatar mithrendal commented on July 22, 2024

logging is now turned off if the load logging console switch is off

from vamigaweb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.