473,788 Members | 2,694 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ClusterListHasP oint(Point ring,
List<CCPixtileL ist)
{
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 1419
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 ClusterListHasP oint(Point ring,
List<CCPixtile List)
{
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<PointptLis t)
{
Predicate<Point p = 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.ch sh.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<PointptLis t)
{
* * Predicate<Point p = 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
1756
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, BusinessObjects, GeneralUtilities, and ASPNETMenu (purchased). Sometime when I will get an error message that says: Parser Error Message: Access is denied: 'ASPnetMenu'. and the aplication will not start. It seems to happen randomly , and it can...
4
1793
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 (IsNull()),,(IIf(Not (IsNull()),,)))))
3
6736
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
2462
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 of these left I suppose. I use project reference where a need to.
0
2785
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 not load type <namespace>.<class>". I call aspnet_compiler from a nant script: aspnet_compiler -nologo -v <virtual path-p <physical path-u -f <target path> The type that cannot be loaded belongs to a user control located in a sub
3
1612
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 to test the front end, I got a lot of errors with respect to the events in my database (ie/ On Dbl Click, After Update), as well as my code "disaappearing" for some strange reason. Please see the links for the types of errors I received: ...
4
1367
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 to login. But when I use the PASSWORD() function, it is not possible to login at all. Is it because of the way I query the database?
3
1480
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 Mail Sent.
4
3776
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 have to store data for each submodel and their respective triangle data, wich are the vertex and neighbor(triangles sharing a common edge) indexes. Now, I'm storing this data in these struct's: struct Face { Face() {} Face(GLushort v0,...
0
9656
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
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10370
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10113
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
9969
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...
0
8995
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
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
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.