473,396 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Speed : The PIA impact (VB 6.0 vs VB.NET)

Hello,

I have made a migration from VB 6.0 to VB.NET and noticed a great speed
change when I access (from VB) to Excel Cells (same problem to write Visio
formulas from VB).
The same code takes 21 seconds in VB 6.0 and 54 seconds in VB.NET (see below)

1. Is that fact well known?
2. How to solve the problem?
3. Can we hope amelioration in latter version?

---------------------------------------------------------

In VB 6.0 the following code is executed in 21 seconds in VB 6.0 and 54
seconds in VB.NET on the same PC:
Dim I As Integer
Dim J As Integer
Dim myExcelApp As Excel.Application
Dim objBook As Excel.Workbook
Dim objSheet As Excel.Worksheet
Dim dStart As Double

Set myExcelApp = CreateObject("Excel.Application")
Set objBook = myExcelApp.Workbooks.Add("D:\toto.xls")
Set objSheet = objBook.Worksheets("Sheet1")

dStart = Timer

For I = 1 To 60
For J = 1 To 100
objSheet.Cells(J, I).Value = 1
Next J
Next I
MsgBox ("This operation took : " & CStr(CInt(Timer - dStart)) & "
seconds")

--------------------------------------------------------------------------------------

Thank you

Philippe

PS : To make yourself the experience on VB.NET, just replace in this VB 6.0
code "Timer" by "Microsoft.VisualBasic.Timer"
Jul 21 '05 #1
3 1338
Philippe TEIRUH <Ph************@discussions.microsoft.com> wrote:
I have made a migration from VB 6.0 to VB.NET and noticed a great speed
change when I access (from VB) to Excel Cells (same problem to write Visio
formulas from VB).
The same code takes 21 seconds in VB 6.0 and 54 seconds in VB.NET (see below)

1. Is that fact well known?
2. How to solve the problem?
3. Can we hope amelioration in latter version?

---------------------------------------------------------

In VB 6.0 the following code is executed in 21 seconds in VB 6.0 and 54
seconds in VB.NET on the same PC:


Is this using Option Strict On or not? I believe interop is much slower
using Option Strict Off than On.

You will probably find that others in the VB.NET group
(microsoft.public.dotnet.languages.vb) or in the interop group
(microsoft.public.dotnet.framework.interop) can give you more
information on that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2
Philippe,

Did you try that in a loop or only one time, dotNet programs can be slower
the first time that the code is used. Which is a general fact for all dotNet
programs what has to do with the JIT compiling.

When that is not the problem there is for VB6 upgrade is a special newsgroup

Microsoft.public.dotnet.languages.vb.upgrade

I hope this helps?

Cor
Jul 21 '05 #3
Thank you for the ideas

I will try on
microsoft.public.dotnet.framework.interop
Microsoft.public.dotnet.languages.vb.upgrade
microsoft.public.dotnet.languages.vb

Philippe

"Cor Ligthert" wrote:
Philippe,

Did you try that in a loop or only one time, dotNet programs can be slower
the first time that the code is used. Which is a general fact for all dotNet
programs what has to do with the JIT compiling.

When that is not the problem there is for VB6 upgrade is a special newsgroup

Microsoft.public.dotnet.languages.vb.upgrade

I hope this helps?

Cor

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: migue | last post by:
way below newbie level: I know nothing about .Net. Have a VB6 client-server application (business app, inventory, purchasing, invoicing, etc.) and am considering converting it to VB.Net at a...
8
by: noid droid | last post by:
Hi. I posted yesterday asking if C# lived up to the hype. Thus far the feedback has been all positive. (Thanks.) Can anyone suggest GOOD books for learning C# and the Visual Studio .NET IDE? ...
3
by: main\(\){}; | last post by:
I can't ignore the speed of .NET managed applications in manipulating string, I/O and arithmetic operations. However, we can never compare the speed of a C/C++ program with its .NET counterpart...
2
by: chrisben | last post by:
Hi All Has anyone done any experiment on comparison between C++ and C# on socket rec/send speed Conditions in Windows system, same CPU for senders or receivers. Can you see how much faster a...
1
by: Grumpy Aero Guy | last post by:
The college I teach VB for just upgraded to .net from VB6 (without ANY warning to the professors--- at least we know where we stand) Therefore, I'm kinda scrambling to get a few rough edges...
25
by: Siv | last post by:
Hi, As part of an evaluation of a small utility that I wrote that converts some data held in a large number of Excel spreadsheets into SQL Server, I decided to convert the utility to VB .NET and...
6
by: Ham | last post by:
Yeah, Gotto work with my VB.Net graphic application for days, do any possible type of code optimization, check for unhandled errors and finally come up with sth that can't process 2D graphics and...
2
by: Frank Milverckowitz | last post by:
Hi, I'm curious to know (need to tell my boss what to expect) how long it might take to come up to speed making the move from Java / JSP to C# ASP.NET I know there are a million factors... but...
184
by: jim | last post by:
In a thread about wrapping .Net applications using Thinstall and Xenocode, it was pointed out that there may be better programming languages/IDEs to use for the purpose of creating standalone,...
318
by: King Raz | last post by:
The shootout site has benchmarks comparing different languages. It includes C# Mono vs Java but not C# .NET vs Java. So I went through all the benchmark on the site ... ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.