[AccessD] William Hindman (Re: Visual Basic 2008 Express&VB.NET)

Stuart McLachlan stuart at lexacorp.com.pg
Sat Mar 14 20:12:08 CDT 2009


On 14 Mar 2009 at 16:22, Rocky Smolin at Beach Access Software wrote:

> I put VPC on a Vista machine. I find that the virtual machines take a big
> performance hit - run and respond visibly slower than native mode.  Do you
> find that as well?

Nope,  but I've seen several reviews on the intertubes that say that VirtualBox is much 
faster than MS VirtualPC. 

A lot apparently depends on what you are doing.

1.   It only takes a few seconds to boot an XP machine. Applications that I have on my 
native Vista and on an XP VM load roughly twice as fast  on the VM as on the main Vista 
machine. SQL Server Management studio goes from about 15 seconds native to about 7 
seconds in VM, similar improvements with Visual Studio 2005 and  Office applications.   
I suspect that a lot of this  is because of the way it's all packed together on the Virtual Disk 
and physical caching and physical disk reads are more efficient.  

Once the application is running things get a bit more complicated.
I tried running some code on Access 2003 in both environments:

1.  I tried the following string and numeric test: 
Option Compare Database
Option Explicit

Function test1() As Double
Dim lngStart As Long
Dim x As Long
Dim y As Long
lngStart = Timer
For x = 1 To 300000000
    y = y + 1
Next
test1 = Timer - lngStart
End Function

Function test2() As Double
Dim lngStart As Long
Dim x As Long
Dim a As String
Dim b As String
Dim c As String
a = "aaaaaaaaaaaa"
b = "bbbbbbbbbbbb"
c = "cccccccccccc"
lngStart = Timer
For x = 1 To 10000000
    a = b
    b = c
    c = a
Next
test2 = Timer - lngStart
End Function

Function RunTests()
Dim dblStringMin As Double
Dim dblStringMax As Double
Dim dblStringAvg As Double
Dim dblLongMin As Double
Dim dbllongMax As Double
Dim dbllongAvg As Double
Dim dblResult As Double
Dim x As Long
dblStringMin = 99999
dblLongMin = 99999
For x = 1 To 10
   dblResult = test1
   If dblResult < dblLongMin Then dblLongMin = dblResult
   If dblResult > dbllongMax Then dbllongMax = dblResult
   dbllongAvg = dbllongAvg + dblResult
   dblResult = test2
   If dblResult < dblStringMin Then dblStringMin = dblResult
   If dblResult > dblStringMax Then dblStringMax = dblResult
   dblStringAvg = dblStringAvg + dblResult
Next
dbllongAvg = dbllongAvg / 10
dblStringAvg = dblStringAvg / 10
Debug.Print "Value", "Long", "String"
Debug.Print "Min", dblLongMin, dblStringMin
Debug.Print "Avg", dbllongAvg, dblStringAvg
Debug.Print "Max", dbllongMax, dblStringMax
End Function

The results were surprising:

VirtualBox XP:
Value         Long          String
Min            3.909         1.912 
Avg            4.4354        2.4519 
Max            5.049         2.997 

Native Vista:
Value         Long          String
Min            3.85546875    3.08984375 
Avg            4.41015625    3.43515625 
Max            5.1796875     3.77734375 

Nothing in the if for the arithmetic, but  XP VB was a lot faster on the string manipulation 
that running native on Vista.

2   I then ran Max's DAo/SQL tests:

Vista native machine: 
SQL Insert Test: 00:00:04
DAO AddNew Test2: 00:00:09

XP VM:
SQL Insert Test:00:00:15
DAO AddNew Test2: 00:00:24

Here the  XP VM is *much* slower than Native. 
I suspect that while sequential reads from the Virtual Disk are very efficient, hence the good 
loading times, random writes would have a lot more overhead.


***Damn**** -  I was a bit concerend about the different precision displays on the first tests 
on tow supposed identical applications, so I just checked my Versions:

XP/VBox is running Office 2003 SP1 (VBA 6.3)
Vista/Native is running Office 2003 SP3 (VBA 6,5)
so  these are not 100% valid comparisons.

For comparison I ran the same tests on my Office 2007 VBox:
The result was essentially the same as the Office 2003 VBox.

Value         Long          String
Min            3.890625      2.0078125 
Avg            4.43046875    2.4953125 
Max            5.46875       3.00390625 


and Max's  DAO/SQL Test gave
SQL Insert Test 00:00:11
DAO AddNew Test2 00:00:19

which is about half way between A2k3 on XP/VBox and Native Vista

YMMV - I'll leave it up to individuals to decide for themselves, but for the way I use VMs I 
have no concerns about any perfomance hit.  

If anything the general impression/ user experience is that  responses are better rather than 
worse and the only place where you see a major slowdown is in applications that do a lot of 
writing to disk.


Anyone care to do a similar set of tests on VirtualPC 2007 for comparison purposes?
-- 
Stuart


  
-------------- next part --------------
The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any other MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

   ---- File information -----------
     File:  Microsoft Office Access 2003.lnk
     Date:  15 Mar 2009, 10:04
     Size:  2601 bytes.
     Type:  Unknown


More information about the AccessD mailing list