|
-
Aug 17th, 2005, 08:22 PM
#1
VisualBasic functions are slower?
I have stumble into this article that are telling using Visual Basic functions (its in the 3.1 section) in .Net is proven to be slower that their .Net counterparts, I just wish to be clarified if this is true...
Last edited by dee-u; Aug 17th, 2005 at 09:11 PM.
-
Aug 17th, 2005, 08:32 PM
#2
Re: VisualBasic Namespace is slower?
At first look its from a beginner and the only reply states that he stole the copyright guidelines since he did not write it himself. Also the comment was from 3/31/2005 and noboby else has commented on it?
Something does not add up so I actually looked at it. It was writtten by someone else back in 2004!
 Originally Posted by Steve Sartain
Making use of the original Visual Basic functions has been proven to be up to 1000 times slower than the .NET counterparts; you have been warned.
Where's the proof to back this claim up? To me, this proves and disproves absolutely nothing.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 17th, 2005, 08:33 PM
#3
Re: VisualBasic Namespace is slower?
Its items from the VisualBasicCompatiblity namespace and yes it is true.
-
Aug 17th, 2005, 08:38 PM
#4
Re: VisualBasic Namespace is slower?
I skimmed through the article and didnt see anything on it. Did you learn this from the article or other source?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 17th, 2005, 08:42 PM
#5
Fanatic Member
Re: VisualBasic Namespace is slower?
When you decompile the .NET assemblies you'll see that most of the methods in the VisualBasic namespace (if not all) are either wrappers for .NET methods or are methods that use .NET methods.
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Aug 17th, 2005, 08:46 PM
#6
Re: VisualBasic Namespace is slower?
Yes, that is true but every post I read on that always states that any difference in performance is miniscule in measure. Where is it shown that its a 1000 times slower?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 17th, 2005, 08:50 PM
#7
Fanatic Member
Re: VisualBasic Namespace is slower?
I don't find it a very enlightening article in general.
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Aug 17th, 2005, 08:51 PM
#8
Re: VisualBasic Namespace is slower?
With that 'doubtful' section, could it be assumed that the whole article is not worthy to follow?
-
Aug 17th, 2005, 08:53 PM
#9
Re: VisualBasic Namespace is slower?
Just like you shouldnt judge a book by its cover, you shouldnt judge the article by one mistake. With a bit of common sense applied when reading it there should be some benefit from its contents. Not a whole lot since like I posted, only a single comment posted.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 17th, 2005, 08:54 PM
#10
Re: VisualBasic Namespace is slower?
I don't think the performance hit is very large but there is one.
"Microsoft.VisualBasic.Compatibility Namespace
The Visual Basic 6.0 Compatibility library is distinct from the Visual Basic Runtime. The Microsoft.VisualBasic.Compatibility namespace is used by the tools that upgrade Visual Basic 6.0 code to Visual Basic .NET. It is a bridge to support Visual Basic 6 features that are not directly supported by the .NET implementation of Visual Basic. Unlike the Visual Basic Runtime, the compatibility library is not implicitly referenced by all Visual Basic .NET applications. When you upgrade a Visual Basic 6 project to Visual Basic .NET, the upgrade wizard adds a reference to Microsoft.VisualBasic.Compatibility.
The compatibility classes should not be used for new development. The Microsoft.VisualBasic.Compatibility namespace adds a layer of complexity to your Visual Basic .NET application and introduces some minimal performance costs that could be eliminated by recoding portions of the application. In addition, the Compatibility namespace often contains many classes that wrap COM objects, and as stated earlier, depending on COM objects is not as optimal as a pure managed implementation. However, the library itself is not overly inefficient and the performance costs will probably not be noticeable in most applications. The rest of this section highlights a few prevalent Visual Basic 6 compatibility features and their performance characteristics."
http://msdn.microsoft.com/library/de...tinternals.asp
http://visualbasic.about.com/library.../aa062103c.htm
http://addressof.com/blog/articles/C...uidelines.aspx
Ultimately its a personal decision and not a very big deal.
-
Aug 17th, 2005, 08:59 PM
#11
Re: VisualBasic Namespace is slower?
However, the library itself is not overly inefficient and the performance costs will probably not be noticeable in most applications.
Thanks Ed. Just as I thought. Its a very minimal difference but the Compatibility namespace is the real dinosaur.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 17th, 2005, 09:03 PM
#12
Re: VisualBasic Namespace is slower?
Yes and it is important to realize that the VisualBasic.Compatibility namespace is not the samething as the VisualBasic namespace and is not required for VisualBasic.
-
Aug 17th, 2005, 09:07 PM
#13
Re: VisualBasic Namespace is slower?
So that means that section is actually referring to VisualBasic.Compatibility and not to VisualBasic NameSpace?
-
Aug 17th, 2005, 09:09 PM
#14
Re: VisualBasic Namespace is slower?
 Originally Posted by dee-u
So that means that section is actually referring to VisualBasic.Compatibility and not to VisualBasic NameSpace?
Correct.
-
Aug 17th, 2005, 09:10 PM
#15
Re: VisualBasic Namespace is slower?
Darn... I should edit this thread's title then...
-
Aug 17th, 2005, 09:19 PM
#16
Re: VisualBasic functions are slower?
As has been said, the Micosoft.VisualBasic.Compatibility namespace is something completely seperate to the Visual Basic Runtime. As I've stated before, all VB.NET Runtime functions are written in 100% VB.NET, so there is no reason to believe that calling a Runtime function would be any slower than calling a function of your own creation that would then call the corresponding System-based property or method. For instance, the Left function would be implemented much like this:
VB Code:
Public Function Left(ByVal Str As String, ByVal Length As Integer) As String
If Length < 0 Then
Throw New ArgumentException("Some message here.")
End If
If Length >= Str.Length Then
Return Str
End If
Return Str.Substring(0, Length)
End Function
There is then the overhead of an additional method call but that difference would be miniscule and completely undetectable unless you were calling Runtime functions in very large numbers.
-
Aug 17th, 2005, 09:47 PM
#17
Re: VisualBasic functions are slower?
I just had a read of that paper and it seems pretty good stuff all up, but that bit about Runtime functions does sound dubious. There may be some very isolated, special case or cases where that statement about them being 1000 times slower is correct, but they are just VB.NET functions like any other. My advice, as always, is to leave the Microsoft.VisualBasic reference where it is but use System-based methods and properties wherever possible. Only use Runtime functions when they add some genuine value. If you are concerned that you might be using Runtime functions without realising it then here's a good rule of thumb. All methods must be qualified with the name of a class for Shared members, or the name of an instance, i.e. a variable. The only exceptions to this are in-built VB.NET functions and methods in a module. The in-built functions are easy to spot because they turn blue in the IDE, so if you type an unqualified method name and it doesn't turn blue then it must be a member of a module. If it is not in a module of your own creation, then it is almost certain to be a Runtime function. You can click it and press F1 to go to the relevant help topic to confirm this.
-
Aug 18th, 2005, 04:05 AM
#18
Re: VisualBasic functions are slower?
In addition to all this, VB.Net is on average about 3% slower than C# for normal day to day stuff.
This is from my own observations, although MSDN does have several pages that do reflect this.
Yeah legacy VB methods are butt-slow and are bad practice anyway so only a fool would contamplate using them.
I don't live here any more.
-
Aug 18th, 2005, 04:08 AM
#19
Re: VisualBasic functions are slower?
 Originally Posted by wossname
In addition to all this, VB.Net is on average about 3% slower than C# for normal day to day stuff.
This is from my own observations, although MSDN does have several pages that do reflect this.
Yeah legacy VB methods are butt-slow and are bad practice anyway so only a fool would contamplate using them.
Hmmmnnn... I thought when they are compiled to IL then there will be no difference in their speed?
-
Aug 18th, 2005, 04:15 AM
#20
Re: VisualBasic functions are slower?
The IL produced by VB.NET and C# is usually very similar and often identical. Overall, though, C# does produce more efficient IL. The thing is, for most everyday applications that difference is imperceptible because the application spends most of its time waiting for the user. Only computationally-intensive applications will show a significant performance edge when written in C# rather than VB.NET.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|