Search found 2269 matches

by jj2007
Feb 14, 2022 9:18
Forum: General
Topic: Calling function does nothing but takes huge amount of time vs called function
Replies: 47
Views: 3226

Re: Calling function does nothing but takes huge amount of time vs called function

You are right, it was in a different *.obj file. Now I created a library ( FloatToStr.lib ). Here is the shortened dump: Dump of file FloatToStr.lib File Type: LIBRARY COFF SYMBOL TABLE 007 00000000 UNDEF notype () External | PowerOf10 00C 00000058 SECT1 notype () External | _FloatToStr@12 So they a...
by jj2007
Feb 14, 2022 0:09
Forum: General
Topic: Calling function does nothing but takes huge amount of time vs called function
Replies: 47
Views: 3226

Re: Calling function does nothing but takes huge amount of time vs called function

Yes, that's what I also saw. But both FloatToStr and PowerOf10 are present in the obj file. I tried option -c but no effect. The linker still kicks in and complains, and no *.obj files generated. I tried this, but no effect: extern "Windows-MS" Declare Sub PowerOf10 Alias "_PowerOf10@...
by jj2007
Feb 13, 2022 23:40
Forum: General
Topic: Calling function does nothing but takes huge amount of time vs called function
Replies: 47
Views: 3226

Re: Calling function does nothing but takes huge amount of time vs called function

^^^^^^^^^^^^ Can anybody get the snippet in the previous post to compile? ^^^^^^^^^^^^
by jj2007
Feb 12, 2022 20:55
Forum: Beginners
Topic: Can Public Functions Access All Program Variables?
Replies: 24
Views: 3270

Re: Can Public Functions Access All Program Variables?

Munair wrote: Feb 10, 2022 18:56If I remember correctly EXTERN is more optimal than SHARED.
The disassembly looks identical, for 32- and 64-bit executables.
by jj2007
Feb 12, 2022 15:17
Forum: General
Topic: Calling function does nothing but takes huge amount of time vs called function
Replies: 47
Views: 3226

Re: Calling function does nothing but takes huge amount of time vs called function

str(double) looks to be a complicated conversion. It is, indeed. The faster Masm32 FloatToStr actually uses the fbstp instruction, which is known as slow but apparently the best choice. I tried compiling a FreeBasic snippet but always get errors ( fptoa.obj is here ): ' OPT_Obj -a fptoa.obj Declare...
by jj2007
Feb 11, 2022 19:17
Forum: General
Topic: Calling function does nothing but takes huge amount of time vs called function
Replies: 47
Views: 3226

Re: Calling function does nothing but takes huge amount of time vs called function

Converting doubles uses sprintf which has to parse a format string and as such, nobody is ever going to use it for performance . So what do people use for performance? To my surprise, I can find only one confused thread on the Masm32 site's Lab that deals with double to string conversion. The stand...
by jj2007
Feb 11, 2022 11:29
Forum: General
Topic: Calling function does nothing but takes huge amount of time vs called function
Replies: 47
Views: 3226

Re: Calling function does nothing but takes huge amount of time vs called function

str() is very slow and is the main culprit IMO. Correct. Try this: if ij = 1 then ' Process the first double. ThisDblStr = "12.34" 'str(myVars.aDbl) digit_ct(1) = extract_stage_02(ThisDblStr, num_digits) else ' Process the second double. ThisDblStr = "12.34" 'str(myVars.bDbl) di...
by jj2007
Feb 10, 2022 22:28
Forum: General
Topic: Calling function does nothing but takes huge amount of time vs called function
Replies: 47
Views: 3226

Re: Calling function does nothing but takes huge amount of time vs called function

cbruce wrote: Feb 10, 2022 21:55Where is all of the time in EXTRACT_STAGE_01() coming from?
It's one procedure that is being called many times. So it takes a while, that's normal.
by jj2007
Feb 10, 2022 15:33
Forum: General
Topic: Calling function does nothing but takes huge amount of time vs called function
Replies: 47
Views: 3226

Re: Calling function does nothing but takes huge amount of time vs called function

Munair wrote: Feb 10, 2022 15:08
jj2007 wrote: Feb 10, 2022 12:21 [The result is PI
Off by 0,00389067341 :|
Sorry, must be a rounding error 8)
by jj2007
Feb 10, 2022 12:21
Forum: General
Topic: Calling function does nothing but takes huge amount of time vs called function
Replies: 47
Views: 3226

Re: Calling function does nothing but takes huge amount of time vs called function

Here is the updated code, with the RND() calls removed from the area in question The result is PI: CallCount TotTime MinTime MaxTime F# FuncName --------- ------- ------- ------- --- -------- 1 3.127624 3.127624 3.127624 1 __FB_MAINPROC__ 200000 3.097910 < 1.0 < 1.0 2 MY_MAIN 1 < 1.0 < 1.0 < 1.0 3 ...
by jj2007
Feb 09, 2022 22:40
Forum: General
Topic: Calling function does nothing but takes huge amount of time vs called function
Replies: 47
Views: 3226

Re: Calling function does nothing but takes huge amount of time vs called function

FB64 Performance PROFILING is ON CallCount TotTime MinTime MaxTime F# FuncName --------- ------- ------- ------- --- -------- 1 < 1.0 < 1.0 < 1.0 1 __FB_MAINPROC__ 1 < 1.0 < 1.0 < 1.0 2 MY_MAIN 1 < 1.0 < 1.0 < 1.0 3 GET_CMDLINE 1 < 1.0 < 1.0 < 1.0 4 SET_OPTIONS 5 < 1.0 < 1.0 < 1.0 5 EXTRACT_STAGE_01...
by jj2007
Feb 09, 2022 17:06
Forum: Community Discussion
Topic: Observations.
Replies: 138
Views: 15538

Re: Observations.

Um... is that some kind of UK internal debate? We read a lot about BoJo and the split society here on the other side of the Channel :wink:
by jj2007
Feb 09, 2022 16:59
Forum: General
Topic: Are line label pointers possible?
Replies: 44
Views: 3201

Re: Are line label pointers possible?

The problem with catching errors before they occur is that on modern, multi-process, multi-user systems, you can get subtle race conditions. For example files could could changed or pulled out from under you. Between the time it takes your program to check for a file's existence, and then to open i...
by jj2007
Feb 09, 2022 12:10
Forum: General
Topic: Are line label pointers possible?
Replies: 44
Views: 3201

Re: Are line label pointers possible?

print "Hello World" Dim lptr as any ptr if 0 then label1: asm mov dword ptr [lptr], offset label1 print "this is label 1 at ";lptr asm ret endif asm call label1 print "that was cute" Sleep Calling a line label works perfectly, in 32- and 64-bit FB, but I have no idea w...