Why stays Global variable empty ?

Just starting out? Need help? Post your questions and find answers here.
bosker
Enthusiast
Enthusiast
Posts: 105
Joined: Fri Jan 08, 2010 11:04 pm
Location: Hampshire, UK

Re: Why stays Global variable empty ?

Post by bosker »

So...
I made a standalone exe with no debug using 'normal' names and another using ridiculously long names.
I compared the exe files and the code is identical.
(There is 1 byte different in the PE header at 0x88 which is the lowest byte of compile time)
When I run these files I get exactly the same time with either one (as you should expect when running exactly the same code).

So variable names have no effect on the final exe code and therefore cannot have any effect on execution time.
The reason for the differences seen lies elsewhere.
juror
Enthusiast
Enthusiast
Posts: 228
Joined: Mon Jul 09, 2007 4:47 pm
Location: Courthouse

Re: Why stays Global variable empty ?

Post by juror »

What's amazing is that so-called "programmers" are supporting the variable name length argument.
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: Why stays Global variable empty ?

Post by Vera »

Fred wrote:The variable name length can't be the cause of the slowdown, as it isn't stored in the final executable: once compiled all is resolved internally in an address, the name is dropped.

Here the speed test with debugger off (not DisableDebugger as it's not the same):

---------------------------
Tests
---------------------------
Test1 999
Test2 999
Test3 999
Test4 999

---------------------------
OK
---------------------------

Which is expected.
Thanks Fred for taking your time and clarifying :-)
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Why stays Global variable empty ?

Post by IdeasVacuum »

What's amazing is that so-called "programmers" are supporting the variable name length argument.
That is an insult. What we really saw here was a frivolous discussion about why there was a few milliseconds difference between results, i.e. whatever the reason it wouldn't be seen as important, but good programmers will always have their curiosity tickled by these things.

If somebody raises a question on this forum, it does not matter whether assumptions they make are right or wrong, we just have a discussion about it. Usually one or more people with prior knowledge can give a conclusive explanation. Sometimes there is a little bit of friendly mud-slinging and so long as it is understood to be friendly, that's fine too. Insults though are not acceptable, this is a friendly forum where everyone helps everyone.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
juror
Enthusiast
Enthusiast
Posts: 228
Joined: Mon Jul 09, 2007 4:47 pm
Location: Courthouse

Re: Why stays Global variable empty ?

Post by juror »

IdeasVacuum wrote:
What's amazing is that so-called "programmers" are supporting the variable name length argument.
That is an insult.
It was meant to be. A real programmer should have some knowledge of computer science and have a clue about how compilers work. You mean PB "programmers" don't know it uses FASM?

Good discussion is one thing. Arguing that a poorly constructed test constitutes "proof" is something else.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Why stays Global variable empty ?

Post by IdeasVacuum »

I mean that a lot (if not the majority?) of the people on this forum are hobbyists. Many are self-taught and actually very skilled but they are unlikely to know everything - but then, who does? There are plenty of professional developers, especially these days, that have less knowledge of what goes on 'under the hood'. We are now blessed with more computing power and storage than we need for most applications, so that's fine. A Formula 1 driver doesn't necessarily understand how the underlying technology of his car works, but he does know how to get the best out of it.

No matter how skilled or not anyone may be in your view, please do not throw insults. It's not nice and it's not necessary. When potential new PB customers see such nastiness they could be deterred, which would be a great shame.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Little John
Addict
Addict
Posts: 4770
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Why stays Global variable empty ?

Post by Little John »

juror wrote:A real programmer should have some knowledge of computer science and have a clue about how compilers work. You mean PB "programmers" don't know it uses FASM?

Good discussion is one thing. Arguing that a poorly constructed test constitutes "proof" is something else.
I agree with you.
Fred
Administrator
Administrator
Posts: 18150
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Why stays Global variable empty ?

Post by Fred »

juror wrote:What's amazing is that so-called "programmers" are supporting the variable name length argument.
No need to be harsh, it's not that obvious. PureBasic is used by a wide range of users, so all questions are legitimates.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Why stays Global variable empty ?

Post by PB »

[Edit] Actually, forget it. I'm over arguing with people on forums. It's not worth it.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
blueb
Addict
Addict
Posts: 1111
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: Why stays Global variable empty ?

Post by blueb »

PB wrote:[Edit] Actually, forget it. I'm over arguing with people on forums. It's not worth it.
The only time I'll argue is when I'm defending PureBasic! :mrgreen:
- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
Little John
Addict
Addict
Posts: 4770
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Why stays Global variable empty ?

Post by Little John »

Fred wrote:so all questions are legitimates.
Probably everyone will agree to this sentence.
And actually I can't see that asking a question did cause any problem here.
juror
Enthusiast
Enthusiast
Posts: 228
Joined: Mon Jul 09, 2007 4:47 pm
Location: Courthouse

Re: Why stays Global variable empty ?

Post by juror »

Fred wrote:
juror wrote:What's amazing is that so-called "programmers" are supporting the variable name length argument.
No need to be harsh, it's not that obvious. PureBasic is used by a wide range of users, so all questions are legitimates.
My apologies Fred. Somehow I associated a "PureBasic Expert" with a real programmer.
Fred
Administrator
Administrator
Posts: 18150
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Why stays Global variable empty ?

Post by Fred »

Very funny. I think it's time to close this thread.
Locked