473,376 Members | 985 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,376 software developers and data experts.

Problems Only When Using Run Without Debugging

Hi Everyone,

I have been having a bizarre problem when I do Run Without Debugging
(I have been doing this do to the intensity of some code which runs
slow when Debugging). When I run without debugging, the application
appears hangs on this code:
private static CCPix ClusterListHasPoint(Point ring,
List<CCPixtileList)
{
for (int i = 0; i < tileList.Count; i++)
{
if (tileList[i].Location.X == ring.X &&
tileList[i].Location.Y == ring.Y)
{
return tileList[i];
}
}
return null;
}
If the if statement is taken out, the loop does eventually finish
without debugging... but ridiculously longer.
With Debugging on, it does not cause a problem. Does anyone have any
thoughts? I've been looking around the web without too much luck :-\ I
have a feeling I am missing something small.
Thanks,

Will
Jun 27 '08 #1
4 1403
Will,
>I have been having a bizarre problem when I do Run Without Debugging
(I have been doing this do to the intensity of some code which runs
slow when Debugging). When I run without debugging, the application
appears hangs on this code:
private static CCPix ClusterListHasPoint(Point ring,
List<CCPixtileList)
{
for (int i = 0; i < tileList.Count; i++)
{
if (tileList[i].Location.X == ring.X &&
tileList[i].Location.Y == ring.Y)
{
return tileList[i];
}
}
return null;
}
If the if statement is taken out, the loop does eventually finish
without debugging... but ridiculously longer.
Not sure I parse this latest statement correctly - what exactly is your problem - does the following loop:

for (int i = 0; i < tileList.Count; i++)
{
}

with the if statement removed, really take long?
>With Debugging on, it does not cause a problem.
Does anyone have any
thoughts? I've been looking around the web without too much luck :-\ I
have a feeling I am missing something small.
I can't see anything obviously wrong with the code posted. Of course, you've not posted all your code - is CCPix special
in some way? Of what type are "Location"? How high is tileList.Count?

Regards,
Gilles.

Jun 27 '08 #2
Will wrote:
Hi Everyone,

I have been having a bizarre problem when I do Run Without Debugging
(I have been doing this do to the intensity of some code which runs
slow when Debugging). When I run without debugging, the application
appears hangs on this code:
[...]
If the if statement is taken out, the loop does eventually finish
without debugging... but ridiculously longer.
If it's not performant enough, why not try a predicate and use tileList.Find()?

http://msdn2.microsoft.com/en-us/library/x0b5b5bc.aspx

Here's an example of what I'm talking about:

public static Point HasPoint(Point tgt, List<PointptList)
{
Predicate<Pointp = new Predicate<Point>(
delegate(Point itm) { return (itm.X == tgt.X && itm.Y == tgt.Y); });

return ptList.Find(p);
}

Chris.
Jun 27 '08 #3
On Apr 24, 8:30*am, Chris Shepherd <c...@nospam.chsh.cawrote:
Will wrote:
Hi Everyone,
I have been having a bizarre problem when I do Run Without Debugging
(I have been doing this do to the intensity of some code which runs
slow when Debugging). When I run without debugging, the application
appears hangs on this code:
[...]
If the if statement is taken out, the loop does eventually finish
without debugging... but ridiculously longer.

If it's not performant enough, why not try a predicate and use tileList.Find()?

http://msdn2.microsoft.com/en-us/library/x0b5b5bc.aspx

Here's an example of what I'm talking about:

public static Point HasPoint(Point tgt, List<PointptList)
{
* * Predicate<Pointp = new Predicate<Point>(
* * * *delegate(Point itm) { return (itm.X == tgt.X && itm.Y == tgt.Y); });

* * *return ptList.Find(p);

}

Chris.
Hi Chris,

Thanks for the post. Interestingly enough, I implemented the Predicate
example you referenced. Now instead of just becoming stuck, Running W/
O Debugging Does finish. It is still approximately executing about 40
times slower though... 240 seconds versus 6 seconds. At least it is a
step in the right direction.
Thanks again,

Will
Jun 27 '08 #4
Will wrote:
Hi Chris,

Thanks for the post. Interestingly enough, I implemented the Predicate
example you referenced. Now instead of just becoming stuck, Running W/
O Debugging Does finish. It is still approximately executing about 40
times slower though... 240 seconds versus 6 seconds. At least it is a
step in the right direction.
How much data are you sifting through?
What is the data stored in (class, or struct could be important here)?

Chris.
Jun 27 '08 #5

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

Similar topics

0
by: Dean | last post by:
This is a problem in ASP.NET, when I run an application from Visual Studio (2003) when I do a "start without debugging". The asp page uses objects that I have built in 3 other projects,...
4
by: Jean | last post by:
Hi all, I am trying to get this query right, but so far no joy... I have written the following code in the Field box of the QBD grid of a query: firstvalue:IIf(Not (IsNull()),,(IIf(Not...
3
by: Benedicte | last post by:
Hi, I'm getting some problems when using fscanf to read a file. This is a piece of the program code: main () { /*** Variable declaration ***/ FILE *vpfile; /*** Data file ***/
1
by: Tony Johansson | last post by:
Hello!! I use VS 2003 and C#. I have sent several mail even tried with crossgroup because I want to find out if my problem is a bug in .NET or if .NET doesn't support what I do. It's only one...
0
by: Bjørn Terje Svennes | last post by:
When compiling my web site with Visual Studio everything works fine. But when bulding on our build server using the aspnet compiler (aspnet_compiler.exe), I get the message "error ASPPARSE: Could...
3
by: PNY | last post by:
Hello, I am using MS Access 2000 and am currently trying to split my database into a front end and backend. I've tried several times to split the database, and everytime, however, once I started...
4
by: Karl | last post by:
Hello. I have a login pages with two fields. One for username and one for password. The username and password are stored in a mysql table. When I am using plain-text password. It is no problem...
3
by: matiruv | last post by:
Warning: mail() : Failed to connect to mailserver at "192.168.0.254" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\selection\Untitled-6.php on line 16...
4
by: Highlander2nd | last post by:
Hello there. I'm Andrew Lucas, I'm a programmer for Half-Life. I've been working on stencil shadows lately, and I've been having problems saving mesh data for my models. When I store mesh data, I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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...

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.