Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Phoenix Edition v3.1 released!
#27
@Stuart It appears as if the culprit to your code being slower is because of the SOUND command -- and it seems as if the reason why it runs faster is because it's glitched in the old OpenAL backend!

Try this code for example:

Code: (Select All)
t# = Timer + 3
Do
    Sound 1000, 1
    Print ".";
    count = count + 1
Loop While Timer < t#

Print count; "runs in 3 seconds"

Now here we're just printing a few dots onto the screen, while playing a sound.  Our call to sound has it playing a C6 note for about 1/18th of a second.  (SOUND's parameters are frequency, duration, and the duration is counted in 1/18th of seconds.)  The result we would expect to see her should be 18 * 3 = 54 runs in 3 seconds.

On my PC, I'm seeing around 60 runs in 3 seconds with the new audio backend.  We're actually running a little faster than we should, but it's not that much faster.

As for the old backend?  This is running for 72,000+ times in 3 seconds, and our tone continues to play long after the program ends!  It's definitely tossing out these sounds -- which should be a program pause in execution -- at an insane rate!!

The old audio backend is glitched rather badly, and it's just something which nobody ever noticed before.  (Much like the issue with Ken's dancing line program -- all we ever got was mono-speaker sound, which worked for his program, and it wasn't until the new backend started producing stereo sound that the glitches in his code became apparent.)

The old version was indeed faster -- but it was insanely faster and broken.  The new one fixes the issue the old one had, and that's where you're seeing the slowdown in your code from.
Reply


Messages In This Thread
Phoenix Edition v3.1 released! - by SMcNeill - 09-04-2022, 02:46 AM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-04-2022, 03:26 AM
RE: Phoenix Edition v3.1 released! - by bplus - 09-04-2022, 04:59 PM
RE: Phoenix Edition v3.1 released! - by OldMoses - 09-04-2022, 05:53 PM
RE: Phoenix Edition v3.1 released! - by bplus - 09-04-2022, 06:59 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-04-2022, 08:31 PM
RE: Phoenix Edition v3.1 released! - by OldMoses - 09-05-2022, 01:32 AM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-04-2022, 06:18 PM
RE: Phoenix Edition v3.1 released! - by Coolman - 09-04-2022, 06:28 PM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-05-2022, 12:19 AM
RE: Phoenix Edition v3.1 released! - by Coolman - 09-05-2022, 10:45 AM
RE: Phoenix Edition v3.1 released! - by Gets - 09-05-2022, 01:31 AM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-05-2022, 02:05 AM
RE: Phoenix Edition v3.1 released! - by Coolman - 09-05-2022, 02:02 PM
RE: Phoenix Edition v3.1 released! - by OldMoses - 09-05-2022, 03:19 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-05-2022, 04:13 PM
RE: Phoenix Edition v3.1 released! - by a740g - 09-05-2022, 04:44 PM
RE: Phoenix Edition v3.1 released! - by Ikerkaz - 09-05-2022, 02:08 PM
RE: Phoenix Edition v3.1 released! - by Coolman - 09-05-2022, 06:09 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-05-2022, 06:29 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-05-2022, 11:25 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-06-2022, 08:37 PM
RE: Phoenix Edition v3.1 released! - by mnrvovrfc - 09-08-2022, 03:54 AM
RE: Phoenix Edition v3.1 released! - by bert22306 - 09-05-2022, 10:00 PM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-06-2022, 01:38 AM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-06-2022, 02:44 AM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-06-2022, 05:24 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-06-2022, 04:43 AM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-06-2022, 05:49 PM
RE: Phoenix Edition v3.1 released! - by Gets - 09-07-2022, 04:01 PM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-08-2022, 10:01 AM
RE: Phoenix Edition v3.1 released! - by a740g - 09-10-2022, 07:10 PM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-10-2022, 11:26 PM



Users browsing this thread: 3 Guest(s)