473,837 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Performance of shared function in clas vs. independent class

Hi,

I have a public shared function in a utility class full of other public
shared functions. It does not get hit that often but when it does the
hit will be long-ish and involve potentially thousands of operations,
though it does not make calls to any other non-system assemblies. What
can I do within .Net to mitigate against this becoming some sort of
bottleneck? For instance, should I move it into it's own assembly?

TIA

Chandy

Aug 25 '05 #1
4 1449
Chandy <ch****@totalis e.co.uk> wrote:
I have a public shared function in a utility class full of other public
shared functions. It does not get hit that often but when it does the
hit will be long-ish and involve potentially thousands of operations,
though it does not make calls to any other non-system assemblies. What
can I do within .Net to mitigate against this becoming some sort of
bottleneck? For instance, should I move it into it's own assembly?


Why would it become a bottleneck? I don't see any reason to move it.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Aug 25 '05 #2
Chandy wrote:
I have a public shared function in a utility class full of other public
shared functions. It does not get hit that often but when it does the
hit will be long-ish and involve potentially thousands of operations,
though it does not make calls to any other non-system assemblies. What
can I do within .Net to mitigate against this becoming some sort of
bottleneck? For instance, should I move it into it's own assembly?


If this method should become a bottleneck, it wouldn't have anything to
do with the class it's defined in or the assembly or anything like that.
You couldn't speed it up by moving it somewhere else.

To speed the method up, you'd have to analyze it, possibly with the help
of profiler software, and restructure or rewrite parts that don't
perform as well as you want them to.

If calls to the method in question slow down the general performance of
your application because they take long to return, you could try using
separate threads for the long-running operations, so that the rest of
your application (especially the GUI) is not effected.
Oliver Sturm
--
omnibus ex nihilo ducendis sufficit unum
Spaces inserted to prevent google email destruction:
MSN oliver @ sturmnet.org Jabber sturm @ amessage.de
ICQ 27142619 http://www.sturmnet.org/blog
Aug 25 '05 #3
Dunno, I don't know enough about the way threading works. I think I
was thinking more a bottleneck for processess that use other methods
within the same assembly but I guess that's daft. Sounds good, I'll
leave it then.

Thanks.

Aug 25 '05 #4
Chandy,

With the exception that you have a multiprocessor computer, will splitting
up your process in more processes never speed up the througput, moreover it
will slow it down.

If your process is visible slow, than I would look if there are no processes
that are maybe not needed repeatly done.

By instance if you use often a property that needs a lot of processing, than
it can sometimes be better to create for that an extra property that holds
the value without processing.

Just my thought,

Cor
Aug 26 '05 #5

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

Similar topics

7
5699
by: Christos TZOTZIOY Georgiou | last post by:
Last night I was compiling the latest python snapshot at my home Linux system (a K6-III @420 --the extra 20 Hz is overclocking :); then I tried building a shared version of the interpreter. I did some speed comparisons, and pystone reported ~6090 pystones for the shared and ~7680 pystones for the (default) static build. This is quite a difference, and while I do know what impact position independent code has on libraries, this was the...
1
3011
by: Torsten Mueller | last post by:
I have to create a shared library containing C++ classes with static member variables on HPUX with aCC. I can compile and link the library and a test application but when I start the program I get errors like these: /usr/lib/dld.sl: Unresolved symbol: namespaces (data) from /beda/lib/libLogicalValidation.sl /usr/lib/dld.sl: Unresolved symbol: m_mapFielTypeIDsUBSHaben__Q2_10Validators9CBaseCopy (data) from...
10
3578
by: John Brock | last post by:
I have a base class with several derived classes (I'm writing in VB.NET). I want each derived class to have a unique class ID (a String), and I want the derived classes to inherit from the base class *Shared* methods which make use of the class ID. So I gave the base class a classID field, and then I gave the derived classes Shared constructors, which I used to set the classID field to the appropriate values for each derived class. But...
11
3366
by: tshad | last post by:
I am setting up some of my functions in a class called MyFunctions. I am not clear as to the best time to set a function as Shared and when not to. For example, I have the following bit manipulation routines in my Class: ******************************************************************************* imports System NameSpace MyFunctions
33
3510
by: Joe Fallon | last post by:
1. I have a Base class that has a certain amount of functionality. 2. Then I have a CodeSmith generated class that inherits from the Base class and adds functionality. 3. Since I want to be able to re-generate the classes on level 2 I have a 3rd level that inherits from them and implements specific hand coded methods. 4. My colleague asked me to create a 4th level class that inherits the 3rd level class so he can write custom...
2
2526
by: Jonesgj | last post by:
Hi, I have a test box which I would like to monitor CPU usage and run queue during the day. I don't want to buy any 3rd party tool, if I can do it easily, as I only need to monitor the box's performance over a week. I thought I could just create a .Net app or service with a timer that gets back this data every so many minutes..
4
15856
by: Brett | last post by:
I'm trying to use the F1 function inside of F2 function below. I keep getting the error posted below the code. If I remove the Shared declaration from F2, it works fine. What exactly does the error mean? Public Class myClass Function F1(ByVal url As String) As Struct1 -- do something -- End Function
4
363
by: Chandy | last post by:
Hi, I have a public shared function in a utility class full of other public shared functions. It does not get hit that often but when it does the hit will be long-ish and involve potentially thousands of operations, though it does not make calls to any other non-system assemblies. What can I do within .Net to mitigate against this becoming some sort of bottleneck? For instance, should I move it into it's own assembly? TIA
10
2118
by: tshad | last post by:
I have a Dll I created in VS 2000. The namespace is MyFunctions and the Class is CryptoUtil. I have a program that is using the Class but it can't access it directly. I have a class (below) called CryptoUtil. The functions are Shared functions. I have this Dll in the bin folder of my program. If I don't reference it - it can't seem to find it. If I have:
0
9843
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10577
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10630
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10275
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7811
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5851
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4476
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4045
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3126
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.