Big difference in performance - due to project settings ?

I wrote a class on which I perform unit-testing before integration in
the main development line, the unit-testing and main dev being two
separate projects.

I wrote a routine which constructs a data structure in the class,
which uses CArrays, vectors, and the nth_element routine from STL,
with the routine being recursive.

Now, in the unit-test project, the routine takes ~3-4 seconds to
execute. In the main development code, it takes ~70 seconds to
execute.

This is measured for the routine itself (no setup or cleanup), same
data as input, same computer, and both projects compiled for debug.

I checked for paging - in both cases the program has at least 100MB of
RAM available, and no process hogging the CPU in the background.

Any idea what causes the 20x performance difference ?

 Thanks, Yonah.

0
9/28/2006 8:20:32 AM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
470 Views

Similar Articles

[PageSpeed] 48

On 28 Sep 2006 01:20:32 -0700, "Yonah" <Yonah.Israeli@gmail.com> wrote:

>I wrote a class on which I perform unit-testing before integration in
>the main development line, the unit-testing and main dev being two
>separate projects.
>
>I wrote a routine which constructs a data structure in the class,
>which uses CArrays, vectors, and the nth_element routine from STL,
>with the routine being recursive.
>
>Now, in the unit-test project, the routine takes ~3-4 seconds to
>execute. In the main development code, it takes ~70 seconds to
>execute.
>
>This is measured for the routine itself (no setup or cleanup), same
>data as input, same computer, and both projects compiled for debug.
>
>I checked for paging - in both cases the program has at least 100MB of
>RAM available, and no process hogging the CPU in the background.
>
>Any idea what causes the 20x performance difference ?

What compiler version? VC2005 introduced some STL debugging functionality
that can really hurt performance. See if the suggestion in this message
helps:

http://groups.google.com/group/microsoft.public.vc.stl/msg/904edb5ad08ddf5d?hl=en&

Also, it would be useful to know if the slowdown affects only debug mode or
release as well.

-- 
Doug Harrison
Visual C++ MVP
0
dsh (2498)
9/28/2006 3:30:38 PM
> What compiler version? VC2005 introduced some STL debugging functionality
> that can really hurt performance. See if the suggestion in this message
> helps:
>
> http://groups.google.com/group/microsoft.public.vc.stl/msg/904edb5ad08ddf5d?hl=en&
>

Thanks. In VS2005, the performance degradation in debug configuration
for us has been over 1000% in some instances. I am shocked that VC team
did not think about providing switches to disable STL debugging. Had we
known this, its very likely we would not have upgraded.

---
Ajay

0
ajaykalra (6842)
9/29/2006 1:05:34 AM
Doug Harrison [MVP] wrote:
> On 28 Sep 2006 01:20:32 -0700, "Yonah" <Yonah.Israeli@gmail.com> wrote:
>
> What compiler version?

Visual Studio 6, which is to be upgraded soon, I hope.

> VC2005 introduced some STL debugging functionality
> that can really hurt performance. See if the suggestion in this message
> helps:
>
> http://groups.google.com/group/microsoft.public.vc.stl/msg/904edb5ad08ddf5d?hl=en&
>
> Also, it would be useful to know if the slowdown affects only debug mode or
> release as well.

I'll check and return with a report.

Yonah.

0
9/29/2006 10:03:55 AM
Doug Harrison [MVP] wrote:
> On 28 Sep 2006 01:20:32 -0700, "Yonah" <Yonah.Israeli@gmail.com> wrote:

[snip]

> What compiler version?

Again, VS6

> VC2005 introduced some STL debugging functionality
> that can really hurt performance. See if the suggestion in this message
> helps:
>
> http://groups.google.com/group/microsoft.public.vc.stl/msg/904edb5ad08ddf5d?hl=en&
>
> Also, it would be useful to know if the slowdown affects only debug mode or
> release as well.

I made a single comparison run, and the difference is far less
dramatic, say 1.5x or 2x slower, which does not really bother me.

Thanks, Yonah.

0
9/29/2006 11:53:09 AM
VS.NET destroyed the IDE and made it completely unusable.  It also had so many bugs in
both the application and the runtime that it was impossible to use.

VS.NET 2003 takes over a minute to start an app because of all the "loading export
symbols" crap it does, which seems completely useless.  Whatever became of the goal of "10
seconds from edit to run".  

VS.NET 2003 also broke edit-and-continue so that after an edit-and-continue, all TRACE
messages fall into the bit bucket and are not seen.

VS.NET 2005 makes the debug runtime nearly unusable.

Is there a pattern here?  Why is it that each release makes the environment WORSE than the
previous release?  Or is this a meaning of the word "improvement" of which I have been
previously unaware?
					joe

On 28 Sep 2006 18:05:34 -0700, "Ajay Kalra" <ajaykalra@yahoo.com> wrote:

>> What compiler version? VC2005 introduced some STL debugging functionality
>> that can really hurt performance. See if the suggestion in this message
>> helps:
>>
>> http://groups.google.com/group/microsoft.public.vc.stl/msg/904edb5ad08ddf5d?hl=en&
>>
>
>Thanks. In VS2005, the performance degradation in debug configuration
>for us has been over 1000% in some instances. I am shocked that VC team
>did not think about providing switches to disable STL debugging. Had we
>known this, its very likely we would not have upgraded.
>
>---
>Ajay
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
9/30/2006 4:25:16 AM
Reply:

Similar Artilces:

How to determine difference?
If I have a cell that is 100 and another cell in which I want to demonstrate the difference - how do I set this up? The problem is that at the moment if I use a simple a1-b1 I get a negative number if b is larger. What I want is it to indicate the change as a +/-. So if A is 100 and B is 105, I would like to cell to indicate 5. If B is 95 - then -5 - does this make sense? Any help is MUCH appreciated. one way: =B1-A1 In article <10v0ggoi91s4c57@corp.supernews.com>, "Fionavar" <fionavarXXX@perlucidus.XXX.net> wrote: > If I have a cell that is 100 and an...

How to set a icons instead of a menu text?
Hello, I'm not quiet sure this can be done , but i would like for some reasons to set icons to describe my menus. Can this be done and how? Many thanks Breadl, It is possible to owner-draw menus, youmight want to check here: http://www.codeproject.com/menu/ and here: http://www.codeguru.com/Cpp/controls/menu/ for samples. Johan Rosengren Abstrakt Mekanik AB "Bredal Jensen" <Bredal.Jensen@mimosa.com> a �crit dans le message de news:%23hH2cnyxEHA.2540@TK2MSFTNGP09.phx.gbl... > > Hello, > I'm not quiet sure this can be done , but i would like for so...

Using OLE DB in MFC Project
Hi, I have developed an MFC application. I now want to add database functionality to it. I have had a look at the various database technologies and have decided to try using direct OLE DB rather than ADO as it is faster. However I have noticed that in tutorials it is recommended to use the wizards in an ATL project. As i have said before my application has been written in MFC. I was wondering how easy it is to add direct OLE DB to my MFC application. I would appreciate suggesstions on how i can manage this, Thanks In Advance Macca ...

Back up failing due to corrupt email
Hello, I have been having an issue with backing up using Veritas ver 10d on an SBS2003 server. Completed status: Failed Final error: 0xe000fe2d - The backup of the item is bad. Final error category: Resource Errors It appears the back up is failing due to several delivery status notifiations that are corrupt. How can I remove these files and have our back up complete other then modifying veritas registry key. Can I remove these files manually? WARNING: "\\servername\Microsoft Exchange Mailboxes\Administrator [administrator]Top of Information StoreSync IssuesServer FailuresŒ...

Password Protect Project Files
Is it possible to password protect local .mpp files in Project '07? I know this functionality is possible in other MS Office applications, but I cannot find that option in Project Pro '07. Does anyone know if it is included in Project 2010? Check File > Save As > Tools > General Options This won't work if you save to the server, but only for local .mpp files. I presume it's the same in 2010. - Andrew Lavinsky Blog: http://blogs.catapultsystems.com/epm > Is it possible to password protect local .mpp files in Project '07? I > know this ...

Can't open file: "The .VBP file for this project contains an invalid or corrupt library references ID"
I'm running Microsoft Excel v.X on a Mac with Panther (OS X). An Excel file which I used a lot now cannot be opened - it says "The .VBP file for this project contains an invalid or corrupt library references ID". I have no idea what this is - it's a single file with just 2 sheets in it, and is fairly simple - no links to outside objects, no graphics, etc. Just a single file. What can I do to get it opened?? Microsoft Word can read it, but I'd like to keep working on it in Excel... Thanks in advance! Mike Levin ...

List of Differences Between Outlook 2000 and Outlook 2003
I need to spend 45 minutes introducing Outlook 2003 to my Outlook 2000 users. Can anyone provide a site with a succinct list (screenshots would help) of differences between Outlook 2000 and Outlook 2003? Many thanks. Tom Are you looking for screenshots of Outlook 2003 or ones comparing OL2000 and 2003? Wouldn't you be a more convincing teacher if used both and took the screenshots yourself? This would help you learn and understand the products better. (Vmware or virtual pc make this really easy and you could show them the differences live. :)) -- Diane Poremsky [MVP - Outlook] ...

Setting up OWA with Windows Certificate
Hi everyone, I need to configure my OWA to make use of a certificate generated by a Windows 2003 server for an Exchnage 2003 server. I know how to do this using third party (Verisign) certs but I need to find a free solution. If you could point me to the correct documentation it would be very much appreciated. Many thanks, Jose One of your options would be to use your own Certificate Authority. You can install this from the Win2k3 Server CD. With that you can generate your own certificate just like verisign. -- This posting is provided "AS IS" with no warranties, and confers...

2007: how is the performance?
Is it faster? Does the process close down properly every time? thanks! adam In microsoft.public.money, msnews.microsoft.com wrote: >Is it faster? For most things, I am not sure. However my files were not slow. > Does the process close down properly every time? That speeded up for me. msmoney.exe shows as closed much quicker in Task Manager, vs 5 seconds or so in 2006. Now how it will do for somebody who had a really long closing cycle, I don't know. > >thanks! > >adam > I may get to that after dinner. Just got home. So many twelve hour days, so little ...

keyboard events for different CWnds
We know that BOOL CTestDialog::PreTranslateMessage(MSG *pMsg) can be used to capture keyboard inputs for some dialog class CTestDialog and in general any window. But consider this.. If I have a MDI application and therein certain Key strokes 'belong' to the mainframe and others to the child frame and perhaps certain others to some other pane or whatever, what is the best way to implement this? For instance, Ctrl+S saves a file in many apps (message goes to MainFrame) and Ctrl+C copies content in the child window (message goes to ChildFrame). What If I want customized key presses for...

What is the difference
What is the difference between IIF condition and IF condition ? "Kutty" <Kutty@discussions.microsoft.com> wrote in message news:46A1B86F-2002-4548-916D-01E0B3F2C602@microsoft.com... > What is the difference between IIF condition and IF condition ? IIf() is a function that can be used directly in a query or control source. If is used in VBA code only. Unless you are thinking of the If() function from Excel in which case that does not apply to Access at all. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com On Feb ...

Macro to open print window and set to print entire workbook
I need help getitng a macro created to open the print window, then se it to 'print the entire workbook'. Then the macro would stop. At whic the user would then specify additional specs for printing. I.E. # o pages, paper size etc. I am trying to default the 'print entire work book option' withou restricting the user from other print specs. I have a macro that will print once a button is clicked on th spreadsheet but it goes directly to print and does not let the user se other specs. I.E. # of pages, etc. Thanks in advanc -- retseor ---------------------------------------...

Performance issue
This is my first MFC project. Most if not all of my experiance has been server side. I have a front end with multiple CControlBar windows (for docking). Some of them need to subscribe to real time messages (stock quotes). A seperate thread is receiving messages off of a TCP socket. This thread then posts messages to the windows queues for them to retrieve data and update views. My problem is that my CPU utlization is too high. Before going through and optimizing the code I want to see if there is a better (more efficent) way to update the windows. Currently there is just one UI thread....

how can I set a scale drawing in visio?
I need to use visio to set up scaled furniture drawings ... file => page setup => drawing scale al "Zvensk" <Zvensk@discussions.microsoft.com> wrote in message news:2CA340AB-58F7-45D1-83EB-369CC5F441B1@microsoft.com... >I need to use visio to set up scaled furniture drawings ... ...

how can i set the outlook express when receive email, the will be stored as a group (like as the newsgroup)
Thanks. Try posting this in an Outlook Express news group - this is not one of them. Outlook is a part of Microsoft Office and is what this group supports. Outlook Express is a part of Internet Explorer and has its own news groups. You can also find some good Outlook Express information here: http://insideoe.tomsterdam.com -- Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. After furious head scratching, Win asked: | Thanks. ...

vbscript insert into access 2003 database with two different table
I am trying to insert data collected by WMI. Here is the script On Error Resume Next Const HKEY_CURRENT_USER = &H80000001 Const HKEY_LOCAL_MACHINE = &H80000002 Const ForReading = 1 'Create FSO Set objFSO = CreateObject("Scripting.FileSystemObject") 'Create an environment for the script to work Set wshshell = WScript.CreateObject("WScript.Shell") 'Connection to the database Set cnn = CreateObject("ADODB.Connection") 'Connection to a Recordset Set objRecordSet = CreateObject("ADODB.Recordset") 'Opens the Database ...

2 different domains/1 exchange server
Hi. I'm currently running E2k03 SP1 as my mail server in our network. Recently another company move in our building (same owner) and both company are sharing network infrastructure. Each company has a different AD domains and this domains are not related in any ways (trust relationship). Is there any way that I can provide mail services to the new neighbors without trusting the domains or using pop3? -- Elvyn Gutierrez Pellerano & Herrera MIS/Lan Manager ...

User login failed on the customized VBA project after GP 10 upgrad
After GP 10 upgrade, I am getting the login failed error for all useers who tried on working on my customized Dynamics VBA project. Error # -2147217843: Login failed for user 'sa'. Procedure: frmDateEntry - cmdProcess_Click Source: Microsoft OLE DB Provider for SQL Server Thanks for help. Kevin Kevin, You might need to re look at your connection in VBA -- Thanks Janakiram M.P. MCP-GP http://janakirammp.blogspot.com "Kevin Zhou" wrote: > After GP 10 upgrade, I am getting the login failed error for all useers who > tried on working on my customized Dynamic...

System/Organisation Settings and Email tracking Settings
my platform: Windows 2003 sp1,SQL 2005 & SQL reporting services,CRM 3.0. exchange is installed on a seperate domain controller. two weeks now into deployment and have managed to overcome most of the installation issues however I have noticed the following BUG: If i try to disable email tracking,or modify any properties within the email tracking settings window,the mail router will fail. 3 times now this has happened. the only way to fix it is to re-install CRM and do not touch the tracking options. ...

Calculate data on 2 different worksheets
I have a very large workbook and for efficiency reasons I have calculation set to manual. I need to calculate 2 different worksheets, but because they refer to each other, I have to calculate them a couple of times to make all of the formulas update correctly. I've tried naming a single range: Range3 = range1,range2 then I use Range("Range3").calculate but the result if only one iteration thru the formulas and the final result still needs one more calculation. Short of putting all the data on one sheet, is there anyway I can insure 2 separate worksheets are completel...

Combine different checkbooks information into one safe pay file
Client has two checkbooks with the same account number. Both checkbooks are included in one upload. In the upload file, a header record is created for each checkbook and the client has to manually delete the second header. The first header is required by the bank; is there a way to suppress the creation of the second header so the client doesn't have to manually edit each upload to remove it? ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in...

set identity_insert not works for insert statement on SQL2008
Dear Experts, I skip all columns name and try a statement "insert into table1 select * from table2 where ...." but always prompt cannot insert IDENTITY_INSERT is on Table1 is the same column structure as table2 (actually I created table2 from running: select * into table2 from table1) I tried both SET IDENTITY_INSERT ON , or SET IDENTITY_INSERT OFF before insert statement , but also not works. Could anyone know how to skip typing all columns name when insert from another table ? Thanks. thomas (thomas@mail.com) writes: > I skip all columns name an...

Date field behavior differs between forms
I have two forms with seemingly identical date fields. In one, if I place my cursor in the middle of it, the first number I type gets put in the far left of the field. In the field on the other form, if I place the cursor in the middle, it starts typing right where I am. Any ideas? I have thoroughly looked through the properties of each field and each form and I cannot find what is causing this behavior. I would love to get both of them to start placing typed characters at the far left instead of where the cursor is. Thanks! Check the Text Alignment property of both controls (not ...

how can I set a pass code to my outlook so only I can open mail
I WANT TO LOCK MY OUTLOOK MAIL SO THAT ONLY I CAN ACCESS.TO OPEN OUTLOOK. you can set a password on the pst - right click on outlook today and choose properties, advanced. also, don't let it remember your email password. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Outlook Tips by email: dailytips-subscribe-request@lists.outlooktips.net EMO - a weekly newsletter about Outlook and Exchange: EMO-NEWSLETTER-SUBSCRIBE-REQUEST@PEACH.EASE.LSOFT.COM You can access this newsgroup by visiting h...

Project 2007 hangs on Autosave
If autosaving kicks in (puts up window with "yes/no/discard") while changing dates in a task, MS Project 2007 hangs. SP2 is installed. Wondering if anybody has ever seen this one ? I've seen it reported on the newsgroup before but no solution was offered apart from checking that SP2 was installed. ...