Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Performance - ProzzesorWord?

Posted on 1999-07-16
9
Medium Priority
?
151 Views
Last Modified: 2012-05-04
As I know in VB an Integer takes tow Bytes, but a ProccesorWord is 4 Bytes long. So, the Processor has always to perform this 2 Bytes to 4 Bytes. Is it perhaps for Performance better, to use a Single, which has 4 Bytes?
0
Comment
Question by:db_tiger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 13

Accepted Solution

by:
Mirkwood earned 300 total points
ID: 1525203
long is the most efficient type
0
 
LVL 1

Author Comment

by:db_tiger
ID: 1525204
I messed up in my question Single and Long, sorry.

But give me please some further Informations:
Does that mean, that I should use everytime a Long, even if I only want to run a For-Next-Loop from 1 to 20!?

And can you say me some URL, where I found further explanation?
0
 
LVL 15

Expert Comment

by:ameba
ID: 1525205
Yes, if you are looking for speed.
Integers can save some memory - if you have biig Integer arrays do not change them to Longs.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Author Comment

by:db_tiger
ID: 1525206
I don't have big Arrays of Integers, but a lot of loops to iterate through arrays.
If I understand right, it won't result in big Memory problems, if I change those loops to long and it will be faster, won't it?


0
 
LVL 15

Expert Comment

by:ameba
ID: 1525207
Si
0
 
LVL 15

Expert Comment

by:ameba
ID: 1525208
Hardcore VB corrections
>>>
What, I wondered, was that Integer doing there? It's almost always wrong to use Integer rather than Long when dealing with the Windows API. I'll go further. It's almost always wrong to use Integer in 32-bit programming. There are exceptions. Some parameters in VB's event procedures are Integer, so you should use matching Integer variables to store copies. You can also use Integer in UDTs to save storage space. But the default size of an integer (note the lowercase) in 32-bit operating systems is Long, and you should use that size unless you have a good reason to do otherwise. I suspect that in this case my only reason for using Integer was negligence. I just left the code unchanged from the first edition of the book.
0
 
LVL 1

Author Comment

by:db_tiger
ID: 1525209
Okay, Mirkwood has answered the question, but you gave me the further explanation that I needed to understand it.
So I would like to split the points up.



0
 
LVL 15

Expert Comment

by:ameba
ID: 1525210
This will be complicated. Just accept Mirkwood's answer - it's OK for me.
0
 
LVL 1

Author Comment

by:db_tiger
ID: 1525211
Fine, thanks again ameba.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question