BBC BASIC for Windows
« PROFILER UTILITY »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:36pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1 2 3  Notify Send Topic Print
 veryhotthread  Author  Topic: PROFILER UTILITY  (Read 5811 times)
Michael Hutton
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 248
xx Re: PROFILER UTILITY
« Reply #21 on: May 5th, 2013, 2:44pm »

No, it doesn't use it's own run time engine anymore. It is compiled with the latest, or is it, hmm. how would I know? Anyway, I am sure it is not the special version of the runtime engine which was required because of some nasty tricks like flushing the @lib$ and @dir$ buffers could lead to whole folders being deleted for some reason. However this is now *not\8 an issue.

So you can find out the lowercase keywords via the registry.

I am will upload the code to the yahoo groups so that it could be updated by anyone who wishes. I don't think I would add to it anymore, except for the lowercase keywords stuff.

Michael


User IP Logged

Michael Hutton
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 248
xx Re: PROFILER UTILITY
« Reply #22 on: May 5th, 2013, 2:59pm »

I have never had a problem with the 64 bit windows. What do you experience?

Michael
User IP Logged

Michael Hutton
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 248
xx Re: PROFILER UTILITY
« Reply #23 on: May 5th, 2013, 4:19pm »

Can I "borrow" the FNreadregistrybin function please?

Michael
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: PROFILER UTILITY
« Reply #24 on: May 5th, 2013, 9:38pm »

on May 5th, 2013, 2:44pm, Michael Hutton wrote:
No, it doesn't use it's own run time engine anymore. It is compiled with the latest, or is it, hmm. how would I know?

I'm not sure that you fully understood the question. The point is that it should not matter whether or not the profiler utility was compiled with the latest run-time engine. It would obviously be highly undesirable to have to re-compile the utility every time a new version of BB4W was released, not to say impossible if the source code isn't available!

The original PROFILER.BBC (in EXAMPLES\TOOLS) doesn't have this problem, because it necessarily runs the user's program using the latest version (efectively it CHAINS the program). But as soon as you turn it into an add-in utility (which runs as a separate process) it become non-trivial to arrange to run the program using the latest version rather than the run-time engine embedded in the EXE.

The only way I can think of to do it is to find the BB4W installation folder from the registry, and then execute the program using the BBCWRUN.EXE to be found there. Is that how the profiler utility currently works?

Quote:
I have never had a problem with the 64 bit windows. What do you experience?

On 64-bits Windows 8, selecting Utilities... Profiler brings up the usual dialogue ('Profiler Utility 3.0d by Michael Hutton April 2009'); on clicking OK the PREPORT.TXT file is displayed immediately even though it was supposed to run the program for 30 seconds! The file says: 'Time spent profiling: 30000 milliseconds' but in fact it was a fraction of a second. It's as if the profiler is running thousands of times faster than real time!

The program I used for test purposes was EXAMPLES\GRAPHICS\CHAIN.BBC. The report file claims that all 30 seconds (actually almost no time at all) was spent in the one statement SYS "LoadImage".

Richard.
User IP Logged

Michael Hutton
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 248
xx Re: PROFILER UTILITY
« Reply #25 on: May 6th, 2013, 08:19am »

Quote:
Is that how the profiler utility currently works?


No, as you say it is non-trivial. In fact, one of the most non-trivial aspects of getting the utility to work is making sure that the @dir$ is correct for the program you are profiling as any resources that the program requires are in that directory rather than the profiler's directory, but that is a side issue.

It is compiled with a fairly recent BB4W run time engine. Although a theoretical problem, I am not sure in reality it is really a problem. As you say there is no active BB4W development but only bug fixes if there is really a need to recompile and ask people to update that really shouldn't be a problem. If that really is an issue (I don't believe so at the moment) then it could easily be recompiled.

Quote:
On 64-bits Windows 8, ......EXAMPLES\GRAPHICS\CHAIN.BBC.


Bizarre. I am using windows 7 64 bit and I can profile Chain. with out any problems. I am sure it is nothing to do with the 64-bit whatsoever I use 64-bit on every computer I have and have never had a problem.

Code:
Profiler report file - Mon.06 May 2013,09:17:40

File - C:\Program Files (x86)\BBC BASIC for Windows\EXAMPLES\GRAPHICS\CHAIN.BBC

Figures in the first column indicate approximate
time in milliseconds spent in each program line.

Figures in the second column indicate approximate
percentage of the total time spent in each program line.

Time spent Profiling       : 12546 milliseconds.

         1:     0.01      REM Chain
         0:               REM by David A. Williams with modifications by Richard T. Russell
         0:               
         0:               balls% = 100
         0:               
         0:               SYS "LoadImage", 0, @dir$+"BALL.ICO", 1, 32, 32, 16 TO H%
         0:               IF H%=0 ERROR 100, "Could not load file BALL.ICO"
         0:               
         0:               MODE 8
         0:               VDU 28,13,28,66,3
         0:               *ESC OFF
         0:               *FLOAT64
         0:               *REFRESH OFF
         0:               
         0:               ON ERROR OSCLI "REFRESH ON":PRINT 'REPORT$:END
         0:               
         0:               t=0
         0:               OFF
         0:               REPEAT
       466:     3.71      CLS
         0:               FOR I%=1 TO balls%
        68:     0.54      C%=320+180*SINRAD(t/3+I%)*COSRAD(t+8*I%)
        56:     0.45      D%=256+180*COSRAD(t/4+2*I%)*SINRAD(t+10*I%)
         7:     0.06      t+=0.03
      1398:    11.14      SYS "DrawIcon", @memhdc%, C%, D%, H%
        12:     0.10      NEXT I%
       126:     1.00      *REFRESH
     10412:    82.99      UNTIL INKEY(2)=32
         0:               *REFRESH ON
         0:               QUIT

         0:               Libraries and immediate mode

 
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: PROFILER UTILITY
« Reply #26 on: May 6th, 2013, 09:13am »

on May 6th, 2013, 08:19am, Michael Hutton wrote:
If that really is an issue (I don't believe so at the moment)

I'm afraid I definitely consider it to be an "issue". Specifically, any program which contains a *TIMER command (added in v5.94a) cannot be profiled, since it will generate a 'Bad command' error. More generally, every new version of BB4W contains bug fixes - that's the primary reason for the annual (or so) releases - so it's not really acceptable for the bugs to 'return' when profiling a program!

Quote:
then it could easily be recompiled.

Not by me! That is the crucial thing - I have no way of updating the profiler utility because I don't have the source. If you decide to release the source then I could recompile it - if I remember - but I'd still prefer it not to be necessary.

Quote:
I am using windows 7 64 bit and I can profile Chain. with out any problems.

I have no access to a 64-bit Windows 7 machine so I can't check that. Are there any specific tests you would like me to perform on the Windows 8 machine to trace the problem?

Quote:
I am sure it is nothing to do with the 64-bit whatsoever I use 64-bit on every computer I have and have never had a problem.

In my experience, compatibility issues are much more likely to be due to the 64-bits than to the version of Windows. For example, as you may know, *RUN doesn't work properly in Win64 (that's something I need to address in the next release of BB4W). And the Unicode string alignment issue, recently discussed on the Yahoo! group, is specific to Win64 too.

I would not anticipate the next version of BB4W being released until the September time-frame, so you have some time to find and fix the fault. But I wouldn't be able to distribute the profiler utility as it stands.

Richard.
User IP Logged

Michael Hutton
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 248
xx Re: PROFILER UTILITY
« Reply #27 on: May 8th, 2013, 3:26pm »

I will email you the code. Unfortunately, I do not have the time to keep the utility up to date and I am not sure I have the skills to do so anyhow. If new 64-bit issues are a problem then you would be the best to address them. Also, the utitlity might of had it's day if there are problems with *TIMER etc, and the need to recompile all the time would make it difficult for me to keep track of the different issues which could arise.

Shame, I enjoyed making it (even if most of it is your code).

Michael
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: PROFILER UTILITY
« Reply #28 on: May 8th, 2013, 4:18pm »

on May 8th, 2013, 3:26pm, Michael Hutton wrote:
I do not have the time to keep the utility up to date and I am not sure I have the skills to do so anyhow

You and me both! My coding abilities are a mere shadow of what they once were, and I find that I make silly mistakes in even the simplest of programs. I am in little doubt that I am suffering from the early stages of dementia.

Quote:
If new 64-bit issues are a problem then you would be the best to address them.

I have only limited access to any 64-bit machines. All the main PCs which I use for testing BB4W (Windows 95, Me, 2000, XP, Windows 7 Home and Windows 7 Pro) are 32-bits. So in that sense I'm not well placed to debug 64-bit issues, but if you haven't the time I'll do what I can. Discontinuing BB4W altogether must be an option, unfortunately.

Richard.
User IP Logged

DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: PROFILER UTILITY
« Reply #29 on: May 10th, 2013, 10:47am »

on May 8th, 2013, 4:18pm, Richard Russell wrote:
...Discontinuing BB4W altogether must be an option, unfortunately.


I certainly hope not, Richard! I use BB4W on 64 bit Vista on my home desktop and 64 bit Windows 7 on my laptop with no detectable problems. I know I don't stretch it much, but I'd be very sorry to lose it (and your outstanding support) for the sake of a few minor issues "at the periphery".

Best wishes,

David
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: PROFILER UTILITY
« Reply #30 on: May 10th, 2013, 5:04pm »

on May 10th, 2013, 10:47am, DDRM wrote:
I'd be very sorry to lose it (and your outstanding support) for the sake of a few minor issues "at the periphery".

One man's "minor issue" is another's "fatal flaw"! Somebody relying on *RUN in their program would no doubt consider the fact that it doesn't work in Win64 to be pretty serious.

Richard.
User IP Logged

Michael Hutton
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 248
xx Re: PROFILER UTILITY
« Reply #31 on: May 14th, 2013, 1:45pm »

I've just sent the file to you Richard.
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: PROFILER UTILITY
« Reply #32 on: May 14th, 2013, 4:09pm »

on May 14th, 2013, 1:45pm, Michael Hutton wrote:
I've just sent the file to you Richard.

Thanks.

Out of interest, what happened to the v4.0b (beta) referred to earlier in the thread, and what were its advantages supposed to be?

Richard.
User IP Logged

Michael Hutton
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 248
xx Re: PROFILER UTILITY
« Reply #33 on: May 15th, 2013, 7:08pm »

I've got that and can send it to you. Basically the timing was done in a seperate thread which I thought might be better. For what reason I cannot remember now. I've used it quite a lot and it doesn't seem to have any other problems which the 3.0d vesion doesn't.

Michael
User IP Logged

Pages: 1 2 3  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls