473,396 Members | 1,784 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.

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 1422
Chandy <ch****@totalise.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.com>
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
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...
1
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...
10
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...
11
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...
33
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...
2
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...
4
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...
4
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...
10
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)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
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,...
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.