Results 1 to 2 of 2

Thread: speed problem

  1. #1

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Angry speed problem

    Hi, I've got a problem concernbing the sped of my application. Is their a easy way to find the spot which causes the speed drop down?

    I'm just drawing lines on a picturebox. When using only lines i could come to a speed of 1:10. Now I'm using the API POLYLINE (there are about 3600 lines) and the speed dropped down to 1:6 why? The only new things are the API and the change of some variables to LONG instead of SINGLE. The speed drops down even if the API isn't realy used?
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  2. #2
    Tygur
    Guest
    Straight out of the MSDN Library:
    For arithmetic operations avoid Currency, Single, and Double variables. Use Long integer variables whenever you can, particularly in loops. The Long integer is the 32-bit CPU's native data type, so operations on them are very fast; if you can’t use the Long variable, Integer or Byte data types are the next best choice. In many cases, you can use Long integers when a floating-point value might otherwise be required. For example, if you always set the ScaleMode property of all your forms and picture controls to either twips or pixels, you can use Long integers for all the size and position values for controls and graphics methods.
    It looks like the changeover from Double to Long probably has a lot to do with the increase in speed.

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