Delphi 7 to Delphi 2010 - much slower

We have decided to move up some applications running under Delphi 7 to 
Delphi 2010.   However, I was surprise to see that simply recompiling the 
application causes the application to be much slower than version 7.  We 
have a lot of string transformation routines, some mathematical 
transformations, etc.   When I mean slower, I mean up to two times slower 
than with Delphi 7, so it not a minor difference.  (The EXE is also a lot 
bigger but I don't worry too much about that).

Is there something I can do to obtain the same kind of speed I had in Delphi 
7 but with Delphi 2010?  Was there some important type changes?  Is there 
any compiler or linker settings that could explain such a decrease in 
performance.
0
Normand
5/31/2013 10:25:23 PM
embarcadero.delphi.general 4258 articles. 0 followers. Follow

7 Replies
1144 Views

Similar Articles

[PageSpeed] 47

Normand wrote:

> We have a lot of string transformation routines, some mathematical
> transformations, etc.

Are they taking into account that strings are now Unicode?

> Is there any compiler or linker settings that could explain such a
> decrease in performance.

Have you tried profiling your code to see where it is actually spending the 
extra time?

--
Remy Lebeau (TeamB)
0
Remy
5/31/2013 11:34:38 PM
Normand Peladeau wrote:

> We have decided to move up some applications running under Delphi 7
> to Delphi 2010.   However, I was surprise to see that simply
> recompiling the application causes the application to be much slower
> than version 7.  We have a lot of string transformation routines,
> some mathematical transformations, etc.   When I mean slower, I mean
> up to two times slower than with Delphi 7, so it not a minor
> difference.  (The EXE is also a lot bigger but I don't worry too much
> about that).
> 
> Is there something I can do to obtain the same kind of speed I had in
> Delphi 7 but with Delphi 2010?  Was there some important type
> changes?  Is there any compiler or linker settings that could explain
> such a decrease in performance.

Make sure you have 

Project -> Options -> Delphi compiler -> compiling -> code generation
-> string format checking -> OFF

that should speed up string operations somewhat.


HTH
ain
0
Ain
6/1/2013 10:52:50 AM
Ain Valtin wrote:

> that should speed up string operations somewhat.

But only for code that is recompiled. The RTL and VCL still use that
stupid ("We make Delphi slower so that our C++Builder customers do not
have to migrate AnsiString to UnicodeString" what they need to do
anyway).

Fortunately this compiler switch was removed in XE.


-- 
Andreas Hausladen
0
Andreas
6/1/2013 11:34:01 AM
On 6/1/2013 2:25 AM, Normand Peladeau wrote:
> We have decided to move up some applications running under Delphi 7 to
> Delphi 2010.   However, I was surprise to see that simply recompiling the
> application causes the application to be much slower than version 7.  We
> have a lot of string transformation routines, some mathematical
> transformations, etc.   When I mean slower, I mean up to two times slower
> than with Delphi 7, so it not a minor difference.  (The EXE is also a lot
> bigger but I don't worry too much about that).
>
> Is there something I can do to obtain the same kind of speed I had in Delphi
> 7 but with Delphi 2010?  Was there some important type changes?  Is there
> any compiler or linker settings that could explain such a decrease in
> performance.
>

classic of the classic thank to the #@{^# unicode support in D2009+ :(
the only way to keep speed (and memory) is to stay on ansiString.
you can try the alcinoe framework 
(http://sourceforge.net/projects/alcinoe/) to convert all your app on
ansiString (their is an app inside alcinoe demo dir called 
stringtoAnsiString that will auto replace all string/pchar and string 
function (intoStr, pos, format, etc..) by their ansiString equivalent.
Alcinoe offer you all the ansitring function like ALinttostr, 
ALfloattostr, ALstringreplace, TALstringList, TALxmlDocument, etc.. 
Their is also inside a demo app to compare the speed between 
unicode/ansistring.
0
loki
6/2/2013 8:58:06 PM
loki loki wrote:

> the only way to keep speed (and memory) is to stay on ansiString.

And fight the RTL and VCL which is Unicode? Converting to AnsiString is
not the way to go. Especially because nobody here knows what the actual
bottle neck is.

-- 
Andreas Hausladen
0
Andreas
6/2/2013 9:24:31 PM
On 6/3/2013 1:24 AM, Andreas Hausladen wrote:
> loki loki wrote:
>
>> the only way to keep speed (and memory) is to stay on ansiString.
>
> And fight the RTL and VCL which is Unicode? Converting to AnsiString is
> not the way to go. Especially because nobody here knows what the actual
> bottle neck is.
>

has i already say good developper know that ansitring = UNICODE if we 
use UTF8. the good choice was for embarcadera to implement unicode
in UTF8 surely not in UTF16 (that is a "bastard" way between utf8 and 
UTF32, because you still have all the default of the UTF8 in utf16 (in 
utf16 like in utf8 charactere can you more than on "codepoint")
0
loki
6/12/2013 7:53:08 AM
loki wrote:

> has i already say good developper know that ansitring = UNICODE if we
> use UTF8. the good choice was for embarcadera to implement unicode
> in UTF8 surely not in UTF16 (that is a "bastard" way between utf8 and
> UTF32, because you still have all the default of the UTF8 in utf16 (in
> utf16 like in utf8 charactere can you more than on "codepoint")

UTF-16 was chosen because at the time, Delphi was still a Windows-only product, 
and Windows itself uses UTF-16.  Going to UTF-8 would not have benefitted 
Delphi, because it still would have required runtime string conversions when 
calling Win32 API functions, just like AnsiString did in earlier Delphi versions 
when running a VCL app on an NT4+ version of Windows.  Making the RTL/VCL 
string type match Windows' actual string usage was an appropriate decision 
at the time.

--
Remy Lebeau (TeamB)
0
Remy
6/12/2013 3:54:02 PM
Reply:

Similar Artilces:

Migrating From Delphi 7 to Delphi 2010
We did not know which forum was the best for this question. We have been wanting to migrate from Delphi 7 to a later version for years but it appears to be a daunting task. We first looked at D2006 and that was a radical new world. We bought D2010 a couple of years ago and not done much with it because there are so many parts to our applications. We have done a few new applications in D2010 and they seem to work okay. D2010 has not been impressive, perhaps because of the strangeness compared to D7. Is is possible for us to do a phased sort of migration where we do a form at a time? ...

Using Delphi 7 and Delphi 2010
I had a project in Delphi 7. I worked on it in Delphi 2010. When I try to open the .dpr again in Delphi 7, the IDE toolbar widens across both monitors, and Delphi 7 locks up. It appears that Delphi 2010 modifies the .dpr in a way that makes Delphi 7 unable to open it again. All my forms & units appear to open fine in D7 after D2010, except for the warnings on the ExplicitHeight and ExplicitWidth properties being missing... I can easily recreate the .dpr, but is this expected behavior? Thanks. Tom Field wrote: > I had a project in Delphi 7. > > I worked o...

Pchar for PansiChar
hello, I use a DLL developed in D7 and not have the same sources. I will use Delphi 2010 and the functions do not work function TkmInitialize(LOGXMLDIR: PChar; TkmByExt: dWord): dWord; stdcall; external 'trackbuffer.dll'; function TkmCreateStream(FileName: PChar; Var Stream: dWord; Var Error: dWord): PChar; stdcall; external 'trackbuffer.dll'; function TkmLogEnd(Stream: dWord; MediaDuration, MediaPosition, MediaType: dWord; MediaName: PChar): dWord; stdcall; external 'trackbuffer.dll'; function TkmIsTkm(FileName: PChar): Bool; stdcall; external 'trackbuffer.dl...

Code works in Delphi 7 but not in Delphi 2010 [Edit]
hello, i have a procedure that open's a file by passing the file name as the parameter to the executable. something like this {code} C : \ P r o g r a m F i l e s \ Da c k e r \ D r a c k e r . e x e " G : \ D E l p h i 7 \ D e l p h i 7 A p p _ l o g . t " {code} The source code is {code} procedure OpenFileWithExe var hReg: HKEY; Ret: Longint; RegDataType, RegDataSize: DWORD; CmdLine: array [0..560] of Char; Len: Integer; SInfo: TStartupInfo; PInfo: TProcessInformation; begin Ret := windows.RegOpenKeyEx(HKEY_CURRENT_USER, ...

Delphi 7 to Delphi XE2
Hi, Still using that old workhorse, Delphi7, but am going to the conference in London hosted by Embarcadero on Delphi XE2. Although I would like to "move with the times" and am keen to get the UNICODE and 64-bit support offered by the latest IDEs, I confess to being more than a little scared about all the UNICODE/String/AnsiString and 32/64 bit issues I'm probably going to fall over. Anyone recently upgraded from Delphi7 to one of the latest Delphi IDEs? Thanks, Alain On 03/02/2012 08:55, Alain Dekker wrote: > Still using that old workhorse, Delphi7, but...

from delphi 6 to delphi 2010
Hi. It is possible, with component RX, dxforumlibrary, InfoPower3000Pro, StringAlignGrid. Accepts communication BDE. Thank by comments. excequiel arostica wrote: >Hi. > It is possible, with component RX, dxforumlibrary, >InfoPower3000Pro, StringAlignGrid. Accepts communication BDE. > >Thank by comments. Rx is dead and sources are taken over by jcl/jvcl. I dont know about the rest of the components and i have no experiences with bde over the last 9 years. excequiel arostica wrote: > Hi. > It is possible, with component RX, dxforumlibrary,...

Delphi 2007 to Delphi 7
I've written a class in Delphi 2007 that is not supported in Delphi 7. What would be the best way to achive what I've done in Delphi 2007 in Delphi 7? Thanks, Tom type BondConstants = class { Bond Types } type BondType = record const TREASURY = 3; AGENCY = 0; CORP = 1; MUNI = 2; SBA = 5; MBS = 4; CMO = 6; end; { Day Count Methods } type DayCount = record const ACTUAL_360 = 2; ACTUAL_365 = 1; ACTUAL_ACTUAL = 1; d30_360 = 0; ...

Delphi XE / Delphi 2010
Hello! I noticed that Embarcadero® Delphi® 2010 Version is not on the list of products on Embarcadero page. Or is it still possible to buy it? Will RAD Studio XE compile programs written in Delphi 2010 without problems.? Thanks. Am 13.09.2010 09:04, schrieb Petra Nemec: > Will RAD Studio XE compile programs written in Delphi 2010 without problems.? As always you will probably have to recreate the projects as the import is still a bit -- special. Christian Hello! Does anybody know if it is still possible to get a Delphi2010 trial version (if yes where)? ...

Delphi 7 to Delphi XE
Have been using Delphi 7 for many moons ( have got later versions but never upgraded to ) My first problem is: Component Palette. in XE it is a small toolbar docked in top right in Delphi 7 it gives a large view of all the components. I am struggling to be able to cope/access my components.in Delphi XE. Can I make the component pallette tool bar the same size as Delphi 7, or is there a fast way to view/choose all available components in XE, that I have not spotted yet? Kind Regards, Robert. Hi, What I know is that in Delphi 2010 and XE you can choose between t...

dll fails when compiled with delphi 2010, but works with delphi 7
I may be doing good if someone can just point me to the right forum I have not created a dll for some time and have not written one with 2010 before. The dll I am creating will be called as a cfx function by either a ColdFusion or BlueDragon webserver. I have written cfx DLLs in the past. The function declaration is below, it is the standard declaration from ColdFusion or Bluegradon documention on creating a CFX. procedure ProcessTagRequest(Request: TCFXRequest); export; cdecl; Since this was the first time using 2010 I wrote a very basic function to build off that was not much mor...

dynamical DLL loading in delphi 7 & delphi 2010
Hello, i am loading a DLL dynamical in Delphi 7 and Delphi 2010: [delphi] var hDLL: THandle; pCode: Pointer; type TProcMainEntry = function: TForm; begin hDll := 0; if FileExists(Pfad + vpeDllName) then hDLL := LoadLibrary(PChar(Pfad + vpeDllName)) else SetLastError(2); if hDLL = 0 then RaiseLastOSError; pCode := GetProcAddress(hDLL, PChar(vpeFunction)); if pCode = nil then RaiseLastOSError; Result := TProcMainEntry(pcode)(); [/delphi] in delphi 7 there's a variable filled with data of the main application which used in the...

Delphi 7 versus Delphi 2010 compiler directive {$Q-}
Hi, Could it be correct that there's a bug in Delphi7 where the compiler directive {$Q-} and {$Q+} works completely the opposite? When trying to build an existing Delhi 7 project in Delphi 2010 i found this weird behaviour. In D7 {$Q-} set overflow cheking on and in Delphi 2010 off ????? Regards, Arno Brinkman ABVisie -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Firebird open source database with many powerful SQL features: http://www.firebirdsql.org http://www.firebirdsql.info General database developer support: http://www.databasedevelopmentforum.com Support list for ...

.EXE is almost twice a big in Delphi 2010 compared to Delphi 7?
While migrating from Delphi 7, I have a program whose .exe is about 18 megs in Delphi 7, but in Delphi 2010, it's about 35 megs. Is this in line with what others have seen, or am I missing some switch? I'm configuring the "Release" Build Configuration. And I'm right-clicking on "Release" in the Project Manager and selecting Build. I haven't been able to find any addition project options to bring this number down: Current Configuration: Emit RTTI: False Debug info: False Map file: Off Include Remote debug symbols: {$WEAKLINKRTTI ON} ...

Delphi and Delphi for .Net
It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. I would like to know is it true all .Net application is slower than Win32 native applicaiton or it is Delphi for .Net only. Your information is great appreciated, Inung On 2011-06-21 18:20:17 +0100, Inung Huang said: > It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. > I would like to know is it true all .Net application is slower than > Win32 native applicaiton or it is Delphi for .Net only. If you are only running the code in the application once then, yes, yo...

Price of upgrade from Delphi 2010 Professional to Delphi 2010 Enterprise?
It's weird, but I could not find the answer on so simple question not in Embarcadero Shop, neither by the forum search. For example, the shop info about Enterprise upgrade says: The Upgrade product is available to registered owners of 2006-2009 versions, blah-blah... So, if I'm Delphi 2010 Professional user, I even not eligible for upgrade? I have to buy a new version of Enterprise??? But if I'm Delphi 2006 Professional user, I can upgrade. Please clarify this nonsense for me. Exact question is in the subject. Thanks! Hi Dmitri, > It's weird, but I could not...

Web resources about - Delphi 7 to Delphi 2010 - much slower - embarcadero.delphi.general

Delphi - Wikipedia, the free encyclopedia
... an archaeological site and a modern town in Greece on the south-western spur of Mount Parnassus in the valley of Phocis . The site of Delphi ...

Delphi Automotive (@DelphiAuto) on Twitter
Log in Sign up You are on Twitter Mobile because you are using an old version of Internet Explorer. Learn more here Delphi Automotive @ DelphiAuto ...

Delphi Connect for Verizon on the App Store on iTunes
Get Delphi Connect for Verizon on the App Store. See screenshots and ratings, and read customer reviews.


Audi working with Delphi to develop autonomous car tech
Audi is developing an iPad-sized device that will pack all the necessary computing power for a self-driving car

US approves China company's acquisition of Delphi biz
The Committee on Foreign Investment in the United States has formally approved the acquisition of Delphi's global production of braking systems ...

Verizon And Delphi Officially Launch Vehicle Diagnostics Service - $250 For The Module, $5 A Month On ...
If you're a car nut, a paranoid parent, or a small business owner looking to do a little, uh, company vehicle economy analysis, Verizon's teamed ...

Watch out Google: Delphi gives Ars a ride in its self-driving car
The automotive components maker gave Ars a preview ride around the neighborhood. MOUNTAIN VIEW, CA—On Thursday morning I met with Delphi at its ...

The skinny on Delphi's autonomous road trip across the United States
Filed under: Green , Videos , Autonomous Last week, Delphi's autonomous car became the first to complete a coast-to-coast trip across the United ...

Delphi partners with WiTricity on automated wireless charging system
One could easily argue that parking between the white lines at any local hangout presents a challenge for some inexperienced drivers. So, why ...

Resources last updated: 12/6/2015 6:15:10 PM