Page 1 of 1

[4.61] ValF() sloooooooower than in 4.51 on Wine

Posted: Thu May 24, 2012 12:14 pm
by Niffo
The code below takes about 10 seconds to execute on PB 4.61 on my machine and about 10 miliseconds on PB 4.51 !
ValF() is about 1000 times slower than in PB 4.51

Code: Select all

t = ElapsedMilliseconds()
For i = 1 To 10000
   a = ValF("1.5")
Next i
Debug ElapsedMilliseconds() - t

Re: [4.61] ValF() sloooooooower than in 4.51

Posted: Thu May 24, 2012 12:28 pm
by gekkonier
debug on/off?

Re: [4.61] ValF() sloooooooower than in 4.51

Posted: Thu May 24, 2012 12:28 pm
by ts-soft
The speed of the debugger is useless!

Code: Select all

t = ElapsedMilliseconds()
For i = 1 To 10000
   a = ValF("1.5")
Next i
MessageRequester("", Str(ElapsedMilliseconds() - t))
No difference!

Greetings - Thomas

Re: [4.61] ValF() sloooooooower than in 4.51

Posted: Thu May 24, 2012 12:34 pm
by MachineCode
Niffo wrote:The code below takes about 10 seconds to execute on PB 4.61 on my machine
Only takes 15 ms on my old XP PC with 4.61 installed. Try a fresh install of PureBasic 4.61 in a new folder and test again.

Re: [4.61] ValF() sloooooooower than in 4.51

Posted: Thu May 24, 2012 1:28 pm
by Fred
No problem here

Re: [4.61] ValF() sloooooooower than in 4.51

Posted: Thu May 24, 2012 2:00 pm
by Niffo
Hum ... ok ... i used to use PB on Wine (on Linux) and this difference seems to only exist on Wine and not on a real Windows :(
This is a real problem for me because one of my big project massively use ValF() and i want to continue to Use PB on Wine.
I suppose it can not be considered as a bug since it is not visible on a real Windows.
But there must be a difference in the code of the ValF() fonction between PB4.51 and PB4.61 that cause Wine to react differently.

Re: [4.61] ValF() sloooooooower than in 4.51

Posted: Thu May 24, 2012 2:10 pm
by Fred
We now always set the locale:

Code: Select all

  #ifdef WINDOWS
    setlocale(LC_NUMERIC, "English"); 
  #endif
because of this bug: http://www.purebasic.fr/english/viewtop ... 4&start=30

Wine has probably a slow way to do it, but that's mainly a Wine problem. I will try to see if getting the locale, compare it and only change it if necessary is faster.

Re: [4.61] ValF() sloooooooower than in 4.51

Posted: Thu May 24, 2012 2:40 pm
by Niffo
Thank you 1000 times ! :)

Re: [4.61] ValF() sloooooooower than in 4.51

Posted: Tue Jun 12, 2012 11:44 pm
by blueznl
Fred wrote:We now always set the locale:

Code: Select all

  #ifdef WINDOWS
    setlocale(LC_NUMERIC, "English"); 
  #endif
because of this bug: http://www.purebasic.fr/english/viewtop ... 4&start=30

Wine has probably a slow way to do it, but that's mainly a Wine problem. I will try to see if getting the locale, compare it and only change it if necessary is faster.
You are not authorised to read this forum.
Don't refer to something if people can't read it :-)

Re: [4.61] ValF() sloooooooower than in 4.51 on Wine

Posted: Wed Jun 13, 2012 10:56 am
by PMV
It was readable when he wrote that. :wink:
After releases fixed bugs are always moved.

Re: [4.61] ValF() sloooooooower than in 4.51 on Wine

Posted: Wed Jun 13, 2012 5:00 pm
by c4s
It was a bug I reported. Under certain circumstances ValF() did not detect "2.3" as a float anymore. The problem was that when opening e.g. OpenFileRequester() other system applications (namely an anti-virus tool but possibly others as well) changed the local setting again - That's probably what PureBasic did as well when our application started.
Anyway, after opening the file requester only "2,3" was detected...

Re: [4.61] ValF() sloooooooower than in 4.51 on Wine

Posted: Wed Dec 05, 2012 4:06 pm
by Niffo
For information, there is the same "problem" with PB 5.00