Why stays Global variable empty ?
Re: Why stays Global variable empty ?
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.
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.
Re: Why stays Global variable empty ?
What's amazing is that so-called "programmers" are supporting the variable name length argument.
Re: Why stays Global variable empty ?
Thanks Fred for taking your time and clarifyingFred 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.

Two growing code-collections: WinApi-Lib by RSBasic ~ LinuxAPI-Lib by Omi
Missing a download-file on the forums? ~ check out this backup page.
Missing a download-file on the forums? ~ check out this backup page.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Why stays Global variable empty ?
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.What's amazing is that so-called "programmers" are supporting the variable name length argument.
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.
If it sounds simple, you have not grasped the complexity.
Re: Why stays Global variable empty ?
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?IdeasVacuum wrote:That is an insult.What's amazing is that so-called "programmers" are supporting the variable name length argument.
Good discussion is one thing. Arguing that a poorly constructed test constitutes "proof" is something else.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Why stays Global variable empty ?
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.
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.
If it sounds simple, you have not grasped the complexity.
-
- Addict
- Posts: 4770
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Why stays Global variable empty ?
I agree with you.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.
Re: Why stays Global variable empty ?
No need to be harsh, it's not that obvious. PureBasic is used by a wide range of users, so all questions are legitimates.juror wrote:What's amazing is that so-called "programmers" are supporting the variable name length argument.
Re: Why stays Global variable empty ?
[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.
"PureBasic won't be object oriented, period" - Fred.
Re: Why stays Global variable empty ?
The only time I'll argue is when I'm defending PureBasic!PB wrote:[Edit] Actually, forget it. I'm over arguing with people on forums. It's not worth it.

- 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
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
-
- Addict
- Posts: 4770
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Why stays Global variable empty ?
Probably everyone will agree to this sentence.Fred wrote:so all questions are legitimates.
And actually I can't see that asking a question did cause any problem here.
Re: Why stays Global variable empty ?
My apologies Fred. Somehow I associated a "PureBasic Expert" with a real programmer.Fred wrote:No need to be harsh, it's not that obvious. PureBasic is used by a wide range of users, so all questions are legitimates.juror wrote:What's amazing is that so-called "programmers" are supporting the variable name length argument.
Re: Why stays Global variable empty ?
Very funny. I think it's time to close this thread.