Results 1 to 3 of 3

Thread: [VB6] OWM: How lean is my program?

  1. #1

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    [VB6] OWM: How lean is my program?

    A tool meant to help answer the question "How lean is my program?"

    OWM runs a specified program and samples its performance until completion. Then the final measurements are displayed, and may optionally be saved as a textual report or CSV data.

    OWM is not a profiler. It only reports final bulk statistics. These are not precise since after process termination values are not available. Instead it samples roughly 10 times per second until statistics are no longer retrievable.


    Saving

    When data is saved to an existing report or CSV file it is appended to the end.

    Effort is made to be locale-aware when writing reports and CSV data. This means respecting "comma as decimal point" and delimiting output columns with semicolons in such cases. Other locale formats should work automatically as well. In the report text the appropriate "thousands separators" should be used too.

    CSV text values are always wrapped in quotes (") with quote characters escaped by doubling (as ""). No other escaping is
    attempted.

    CSV output files always use the ANSI encoding of the current locale.


    Requirements

    Requires at least Windows 2000, but some things might fail before Windows Vista.

    Only tested on Windows 10.


    Sample report (U.S. English locale)

    Code:
                            Program ExportQuery.exe
                  Run date and time 2/2/2017 1:09:14 PM
                               Note 
                          Exit code 0
                        Termination Normal
                       Elapsed time 2,074 ms
                   CPU: Kernel time 62 ms
                     CPU: User time 953 ms
                    CPU: Total time 1,015 ms
               I/O: Read operations 119
              I/O: Write operations 149
              I/O: Other operations 295
              I/O: Total operations 563
        I/O: Read bytes transferred 2,408,900 bytes
       I/O: Write bytes transferred 607,823 bytes
       I/O: Other bytes transferred 4,012 bytes
       I/O: Total bytes transferred 3,020,735 bytes
                Memory: Page faults 6,127
      Memory: Peak total workingset 22,450,176 bytes
       Memory: Avg total workingset 22,437,374 bytes
     Memory: Peak shared workingset 11,223,040 bytes
      Memory: Avg shared workingset 11,210,238 bytes
    Memory: Peak private workingset 11,227,136 bytes
     Memory: Avg private workingset 11,227,136 bytes
       Memory: Peak pagedpool usage 166,912 bytes
    Memory: Peak nonpagedpool usage 8,960 bytes
        Memory: Peak pagefile usage 13,578,240 bytes

    There is more information in the included ReadMe.txt file.
    Attached Files Attached Files

  2. #2
    Fanatic Member
    Join Date
    Apr 2015
    Location
    Finland
    Posts
    694

    Re: [VB6] OWM: How lean is my program?

    Bug in;

    Code:
    Stats(19) = (Stats(19) * StatsCount + WorkingSetSize) \ (StatsCount + 1)
    ProcCounters - GetStats - Stats(19) - runtime error '6' Overflow

    ? Stats(19)
    33849395
    ? StatsCount
    63
    ? WorkingSetSize
    34754560

  3. #3

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: [VB6] OWM: How lean is my program?

    Thanks. Silly bug, but should be fixed now.

    The problem was the use of the integer divide which demoted the subexpressions to Long.
    Attached Files Attached Files
    Last edited by dilettante; Feb 22nd, 2017 at 07:37 PM. Reason: re-posted attachment with more accurate fix

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width