The problem is it takes just over 10 minutes to run on version 1.2 of QB64 On version 0.954 it takes 23 seconds. That is it is 26x slower on the newer version! I would have put this in "bugs" but it does not seem I can post there.
Title: Re: Slow string handling
Post by: Pete on July 15, 2019, 03:49:06 pm
Well, we can't test it, because you did not include the string x().
Pete
Title: Re: Slow string handling
Post by: Petr on July 15, 2019, 03:52:45 pm
And what, if you dont use MID$ but both parameters in ASC (string, position) -> ASC ("Test", 2) return ASC for "e".
Title: Re: Slow string handling
Post by: SMcNeill on July 15, 2019, 04:32:22 pm
Isn’t this basically MKI$ And CVI at work? Convert an integer to a 2-byte string, and then back again....
I did find that printing out all the crazy random ASCII in setting up test for x(i), THAT took forever just to get 1000!
Title: Re: Slow string handling
Post by: david_uwi on July 16, 2019, 08:12:37 am
Well it seems that it is printing to the screen that is slow in version 1.2 Of course it helps using numbers rather than strings, but this is a small saving compared to suspressing screen output.
the code above works (though it is still slightly slower than QB64 v0.954). The program takes input from a COM port and writes it to a file. The writing to a file on the hard drive seems quick as it can be achieved at the same time as reading form the port. The COM port is actually working at about 190,000 baud (524288 2byte integers in about 44 seconds)
Title: Re: Slow string handling
Post by: david_uwi on July 16, 2019, 11:21:04 am
A further revelation. It is actually specifying the TTF font for the output that is causing the slowness. Using the default font and it is quick.
Also I cannot seem to get QB64 v1.3 to run
the compilelog shows the following The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified.
Title: Re: Slow string handling
Post by: Petr on July 16, 2019, 12:42:52 pm
Is this a clean installation to a new folder?
Title: Re: Slow string handling
Post by: david_uwi on July 16, 2019, 12:50:46 pm
Yes it seems to have unzipped correctly into a new folder. Does the folder need to have a specific name?
Title: Re: Slow string handling
Post by: Pete on July 16, 2019, 01:24:57 pm
"new folder"
That has a space in it.
Well, you could try renaming it newfolder, no space, and give it a try.
I just unzip the qb64 folder straight off the C:\ drive. Anyway, this is just a shot in the dark, but SHELL calls, for instance, require double quotes to recognize path names with space(s) in them.
Pete
Title: Re: Slow string handling
Post by: Petr on July 16, 2019, 01:41:37 pm
The folder may not have a specific name, but it may be that you may need to set the necessary permissions for QB64.exe if you install it on a system disk. I suppose we're talking about installing under Windows. I have QB64 on a disk where there is no system and have none problem.
Title: Re: Slow string handling
Post by: david_uwi on July 16, 2019, 02:38:34 pm
How strange I've downloaded the file (qb64v1.3) again and it now works.
Anyway thanks for the help you made me try different things until it became obvious the the only thing left was the font declaration. Maybe there should be a note in the WIKI that using fancy fonts can/will slow down execution.
Just a final note on the serial communication. My computer is acting as a "slave' so the external device is dictating the baud rate. So with an external "master" QB64 will accept data at a rate greater than is given in the specifications. (It doesn't matter what rate I set in the OPEN COM statement). Just for fun I've tried overclocking, but it would seem that the limit is about 250 kbaud not much more than the 190 kbaud measure when running at normal speed. Even so despite these blistering rates (for a standard serial port) it takes 44seconds to transfer 1 Mbyte.
Title: Re: Slow string handling
Post by: SMcNeill on July 16, 2019, 03:09:54 pm
times.ttf is a variable-width font, so it’s going to be much slower to render and draw. If you load a monospace font, you probably won’t see anywhere near the same delay.