Performance problems in Windows 64-bit services due to dynamic_cast

Performance problems in Windows 64-bit services due to dynamic_cast

book

Article ID: KB0090641

calendar_today

Updated On:

Products Versions
TIBCO DataSynapse GridServer -
Not Applicable -

Description

Resolution:
One or two customers have noticed performance problems when moving from 32-bit to 64-bit Windows services. These problems are severe: as much as a 2x slowdown in service execution time.

Our investigation for the customers in question has determined that there might be severe performance problems using the dynamic_cast operator in 64 bit windows code, particularly if you use dynamic_cast in a tight loop. Here is a Microsoft blog article which describes the issue - http://archives.windowshpc.net/blogs/dev_gen/archive/2006/10/17/647.aspx.

To summarize, the RTTI code only handles 32-bit pointers, in order to assure compatibility with existing 32-bit code. As a result, the dynamic_cast operator has to scan each and every DLL to see if the 32-bit RTTI information corresponds to a valid object in that particular DLL. This is not a recipe for good performance.

Issue/Introduction

Performance problems in Windows 64-bit services due to dynamic_cast