473,395 Members | 1,815 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,395 software developers and data experts.

Performance Issue with Custom Data Structures

Hello:

I am experiencing performance related issues when my custom data
structures work with value types. I use generics to prevent boxing
wherever I can. For instance, I use IEqualityComparer, etc. I have
gone through most of my data structures and verified that I don't
compare to null or call methods that would box my value types.

However, I am still experiencing performance problems. I can process
strings faster than I can process integers, which seems a little
backwards. I feel like I am overlooking some boxing taking place, but
I can't think where it could be. Could someone please clue me in to
additional things to keep an eyes open for? It would be really awesome
to eliminate any unforeseen bottlenecks.

Thanks,
Travis
Oct 5 '08 #1
1 1432
On Sun, 05 Oct 2008 12:44:09 -0700, je**********@gmail.com
<je**********@gmail.comwrote:
Hello:

I am experiencing performance related issues when my custom data
structures work with value types. I use generics to prevent boxing
wherever I can. For instance, I use IEqualityComparer, etc. I have
gone through most of my data structures and verified that I don't
compare to null or call methods that would box my value types.

However, I am still experiencing performance problems. I can process
strings faster than I can process integers, which seems a little
backwards. I feel like I am overlooking some boxing taking place, but
I can't think where it could be. Could someone please clue me in to
additional things to keep an eyes open for? It would be really awesome
to eliminate any unforeseen bottlenecks.
As in the previous thread, impossible to answer without seeing your code.

There are all sorts of tradeoffs with respect to value types versus
reference types. Certain kinds of operations with value types can be more
expensive, especially if they are relatively large and wind up copied a
lot. On the other hand, a value type can provide better semantics,
especially if they are small and immutable. Of course, whether you
declare a data structure as a struct or a class, if it's used in an
inappropriate way or the code has some fundamental architectural flaw,
that will likely hide whatever performance difference might be apparent
due simply to the kind of data type used.

If the _only_ difference between your test cases is that in one a string
is used and in the other an int is used, then sure...that does sound like
you might have some boxing going on in the int case. But without a code
example, it's impossible to say for sure whether that's what's going on,
never mind in what way. And if there are any other differences in the
test cases, then all bets are off. It could be boxing, or it could be
something completely different.

If you are unwilling to post code examples, you might as well stop asking
these kinds of questions. No one can answer questions about how your code
works without seeing the code. Write a concise-but-complete code sample
that demonstrates the performance difference you're seeing, and post it
here. Only then can someone else take a look at it and explain the
performance difference.

Pete
Oct 5 '08 #2

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

Similar topics

8
by: Rodd Snook | last post by:
I have an application which makes extensive use of the Scripting.Dictionary object. I'm not doing anything silly like putting them outside the page scope -- just creating quite a few of them and...
1
by: Greg Merideth | last post by:
I have a custom service running under win2k3 that grabs performance data and stores it into a sql database. I've noticed on occasion when the data gathering stops, using the sysinternals process...
1
by: Kelvin | last post by:
to All, I'm a newbie in VC++, can anyone tell me about the performance in various Data Structures (eg. Enum, map, list, vector, hash, arrayList)? I would like to know performance on CPU and...
19
by: Tom Jastrzebski | last post by:
Hello, I was just testing VB.Net on Framework.Net 2.0 performance when I run into the this problem. This trivial code attached below executed hundreds, if not thousand times faster in VB 6.0...
48
by: Alex Chudnovsky | last post by:
I have come across with what appears to be a significant performance bug in ..NET 2.0 ArrayList.Sort method when compared with Array.Sort on the same data. Same data on the same CPU gets sorted a...
5
by: Suhas Vengilat | last post by:
Hi All, In one of the project discussions, one team member raised a question whether the usage of asp.net validation controls (like RequiredFieldValidator, CustomValidator, RegularExpression...
7
by: tman | last post by:
I am generating a very large tree list in my program and while it's performance is great once loaded it takes a really long time to load. I create a root TreeNode "offline" and go through the...
13
by: atlaste | last post by:
Hi, I'm currently developing an application that uses a lot of computational power, disk access and memory caching (to be more exact: an information retrieval platform). In these kind of...
12
by: Ilyas | last post by:
Hi all I have an application which brings back 1000 records from a sql server database. Under the local asp.net development server provided with Visual Studio 2008, it takes about 1.8 seconds ...
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...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...
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.