Hey all,
Having YouTube open in Google Chrome increases the multi-threaded performance of my FreeBASIC program by about 5%. It does not happen with other web sites. Tested multiple times so this is not because of the margin of error and I have noticed this over a period of about 2 years.
I am stupefied, what is going on here?
* Having YouTube open in Microsoft Edge does NOT increase multi-threaded performance of my FreeBASIC program.
YouTube increases FreeBASIC performance (solved)
YouTube increases FreeBASIC performance (solved)
Last edited by Provoni on Oct 19, 2019 13:01, edited 1 time in total.
Re: YouTube increases FreeBASIC performance
Certain browsers allow YouTube to set the internal resolution of the timer to a lower value, as discussed here. See also this FB thread:
jj:
jj:
dodicat:some applications, notably Firefox, have the bad habit to set 1 ms resolution when playing videos on YouTube etc, and that's a system-wide setting
Are you using timers in your programs? If so, have a look at TimeBeginPeriod.Google chrome is another to make sleep 1 = 1 ms
Re: YouTube increases FreeBASIC performance
This is normal. Default Windows settings are power saving. The increased demand on CPU causes the CPU to increase its frequency. The algorithms for that are complex and can't always be predicted easily.
You can however indicate that you want a higher performance profile (e.g. for benchmarking). Go to control panel (alt-I) then to system->power and then on the right, click the first option (additional power settings) and set to high performance. Sometimes you need to unhide the profiles below the bar to find "high performance".
You can however indicate that you want a higher performance profile (e.g. for benchmarking). Go to control panel (alt-I) then to system->power and then on the right, click the first option (additional power settings) and set to high performance. Sometimes you need to unhide the profiles below the bar to find "high performance".
-
- Posts: 2958
- Joined: Jun 02, 2015 16:24
Re: YouTube increases FreeBASIC performance
Hi marcov,marcov wrote:This is normal. Default Windows settings are power saving. The increased demand on CPU causes the CPU to increase its frequency. The algorithms for that are complex and can't always be predicted easily.
You can however indicate that you want a higher performance profile (e.g. for benchmarking). Go to control panel (alt-I) then to system->power and then on the right, click the first option (additional power settings) and set to high performance. Sometimes you need to unhide the profiles below the bar to find "high performance".
I don't have those options where you point it (french version I suppose). However if I click at the battery icon on the taskbar I can set the mode to "optimal performance" rather than "autonomy first" or "medium", (I translate approximatively from french. Is this equivalent to the settings you mentionned?
Re: YouTube increases FreeBASIC performance
Thanks allot jj2007, this is the cause, I have confirmed it by changing the sleep values.jj2007 wrote:Certain browsers allow YouTube to set the internal resolution of the timer to a lower value, as discussed here. See also this FB thread:
jj:dodicat:some applications, notably Firefox, have the bad habit to set 1 ms resolution when playing videos on YouTube etc, and that's a system-wide settingAre you using timers in your programs? If so, have a look at TimeBeginPeriod.Google chrome is another to make sleep 1 = 1 ms
Re: YouTube increases FreeBASIC performance (solved)
That's why I still have a reluctance to use SLEEP with a value <15 ms (under Windows), because the actual value applied may depend on the context (timeBeginPeriod()/timeEndPeriod() not multitasking safe).
Re: YouTube increases FreeBASIC performance (solved)
After I read this I went and tested something: If Sleep(16,1) gives right around a desired 60 FPS for a game, is this more trustworthy/stable than using the functions mentioned, such as:fxm wrote:That's why I still have a reluctance to use SLEEP with a value <15 ms (under Windows), because the actual value applied may depend on the context (timeBeginPeriod()/timeEndPeriod() not multitasking safe).
Code: Select all
Do: timeBeginPeriod(1) : Sleep(1,1): timeEndPeriod(1) : Loop Until (Timer - time_start) >= (1/60)