CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: CPU Usage

  1. #1
    Join Date
    Oct 2006
    Posts
    12

    CPU Usage

    I just finished a program that basically waits for tag files to be put into the directory its pointing too and then executes commands based on what the tag file is. When it loads, it loads information from a database to an arrray and then loops.

    I noticed that the cpu usage is jumping between 25-35% and I'm curious if there is anything I can do about it.

    I have a program that does the same thing written in Winbatch and that jumps between 0%-20%.

    Lemme know if more information is needed.

    fyi - I'm writing in C# to broaden my horizons.

  2. #2
    Join Date
    Nov 2004
    Location
    LA. California Raiders #1 AKA: Gangsta Yoda™
    Posts
    616

    Re: CPU Usage

    Well, WinBatch is a scripting language and doe not have the heavy FrameWork to interact with. But then again, WinBatch is not anywhere nearly as powerful as .NET.

    Optimizing your app could be done with some freeware analyzer utilities or if your running the Team system you will have analyzer utilities already installed with it.

    It all just depends on what your app is doing and the code logic. Doing many loops where you could do things in a single line are a good place to start. Inserts into a db with a stored procedure instead of executing unprepared sql statements is another point to look at etc.
    VB/Office Guru™ (AKA: Gangsta Yoda™)
    VB Forums - Super Moderator 2001-Present

    Microsoft MVP 2006-2011

    Please use [code]your code goes in here[/code] tags when posting code.

    Senior Software Engineer MCP, BSEE, CET
    VS 2012 Premium, VS 6.0 Enterprise SP6, VSTO, Office Ultimate 2010, Windows 7 Ultimate
    Star Wars Gangsta Rap SE Reputations & Rating Posts Office Primary Interop AssembliesAdvanced VB/Office Guru™ Word SpellChecker™.NETAdvanced VB/Office Guru™ Word SpellChecker™ VB6Outlook Global Address ListVB6/Crystal Report Ex.VB6/CR Print Setup Dialog Ex.

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

Featured