Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: performance of 64bit output and other questions


This question is not answered. Helpful answers available: 0. Correct answers available: 1.


Permlink Replies: 9 - Last Post: Dec 21, 2015 11:33 PM Last Post By: Dale Chant
Oliver Weinheimer

Posts: 73
Registered: 8/20/04
performance of 64bit output and other questions  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 26, 2015 3:08 AM
I ported a large project form XE7 to Seattle.
Porting was not a large problem (first positive surprise) - but the execution speed of the new CX based release build (64bit) is VERY slow compared to the XE7 build of the same project.

To learn more about the reasons I used following code to compare the output of XE7 and CX and ... was surprised.

// begin code
#include <stdio.h>
#include <time.h>
#include <iostream>

int _tmain(int argc, _TCHAR* argv[])
{

clock_t start, end;
start = clock();
double sum =0;
double clk_tck = 1000.0;
for (int i = 1; i <= 100000000; ++i)
sum += std::sqrt(static_cast<double>(i));
end = clock();
std::cout << "sum: " << sum << '\t' << "Time: "
<< (end - start) / clk_tck << std::endl;
std::cout << "Press Enter to exit..." << std::endl;
std::cin.get();

return 0;
}
// end code

I get the following
64bit debug
XE7 : time: 4.477 sum: 6.66667e+11
CX : time: 0.717 sum: 6.66667e+11

64bit release
XE7 : time: 0.593 sum: 6.66667e+11
CX : time: 0.717 sum: 6.66667e+11

32bit debug
XE7 : time: 4.492 sum: 6.66667e+11
CX bcc32 : time: 0.499 sum: 6.66667e+11
CX bcc32c : time: 1.99916e+37 sum: -3.21483e+18 (but values are Ok in the debugger)

32bit release
XE7 : 0.592
CX bcc32 : time: 0.499 sum: 6.66667e+11
CX bcc32c : time: 1.99916e+37 sum: -3.21483e+18

This gives me a lot of questions:
1) No time difference between release and debug for CX 64bit, but it is possible to use debug points in the debug build
2) I do not understand what bcc32c is doing?
3) 64bit XE7 release output is faster than 64bit CX output - that is a really annoying.
4) ...

Can someone bring some light into this?

Edited by: Oliver Weinheimer on Oct 26, 2015 3:09 AM

Johannes Weinert

Posts: 90
Registered: 7/19/02
Re: performance of 64bit output and other questions [Edit]
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 26, 2015 3:58 AM   in response to: Oliver Weinheimer in response to: Oliver Weinheimer
Hi,

I can not tell anything regarding the execution time. But the strange
bcc32c output is "just" a bug:
<https://quality.embarcadero.com/browse/RSP-11914>
which should be fixed in Update 1.

In the meantime you could use sprintf() alternatively.

Regards

Hans

Am 26.10.2015 um 11:38 schrieb Oliver Weinheimer:
I ported a large project form XE7 to Seattle.
Porting was not a large problem (first positive surprise) - but the execution speed of the new CX based release build (64bit) is VERY slow compared to the XE7 build of the same project.

To learn more about the reasons I used following code to compare the output of XE7 and CX and ... was surprised.

// begin code
#include <stdio.h>
#include <time.h>
#include <iostream>

int _tmain(int argc, _TCHAR* argv[])
{

clock_t start, end;
start = clock();
double sum =0;
double clk_tck = 1000.0;
for (int i = 1; i <= 100000000; ++i)
sum += std::sqrt(static_cast<double>(i));
end = clock();
std::cout << "sum: " << sum << '\t' << "Time: "
<< (end - start) / clk_tck << std::endl;
std::cout << "Press Enter to exit..." << std::endl;
std::cin.get();

return 0;
}
// end code

I get the following
64bit debug
XE7 : time: 4.477 sum: 6.66667e+11
CX : time: 0.717 sum: 6.66667e+11

64bit release
XE7 : time: 0.593 sum: 6.66667e+11
CX : time: 0.717 sum: 6.66667e+11

32bit debug
XE7 : time: 4.492 sum: 6.66667e+11
CX bcc32 : time: 0.499 sum: 6.66667e+11
CX bcc32c : time: 1.99916e+37 sum: -3.21483e+18 (but values are Ok in the debugger)

32bit release
XE7 : 0.592
CX bcc32 : time: 0.499 sum: 6.66667e+11
CX bcc32c : time: 1.99916e+37 sum: -3.21483e+18

This gives me a lot of questions:
1) No time difference between release and debug for CX 64bit, but it is possible to use debug points in the debug build
2) I do not understand what bcc32c is doing?
3) 64bit XE7 release output is faster than 64bit CX output - that is a really annoying.
4) ...

Can someone bring some light into this?

Edited by: Oliver Weinheimer on Oct 26, 2015 3:09 AM

Oliver Weinheimer

Posts: 73
Registered: 8/20/04
Re: performance of 64bit output and other questions [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 26, 2015 4:22 AM   in response to: Johannes Weinert in response to: Johannes Weinert
Thanks Hans, for this clarification - I will give bcc32c a new try after the next Update.
But the most interesting questions for me is the slow execution time of the 64bit output - I can not use Seattle if there is no way to get more performance for the 64bit output.
In the small example I get +20% for the CX 64bit release build and for my large project I get a lot more than 100% ...

Johannes Weinert wrote:
Hi,

I can not tell anything regarding the execution time. But the strange
bcc32c output is "just" a bug:
<https://quality.embarcadero.com/browse/RSP-11914>
which should be fixed in Update 1.

In the meantime you could use sprintf() alternatively.

Regards

Hans
Sean Hoffman

Posts: 126
Registered: 3/28/99
Re: performance of 64bit output and other questions [Edit]
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 26, 2015 4:52 AM   in response to: Oliver Weinheimer in response to: Oliver Weinheimer
Oliver Weinheimer wrote:
Thanks Hans, for this clarification - I will give bcc32c a new try after the next Update.
But the most interesting questions for me is the slow execution time of the 64bit output - I can not use Seattle if there is no way to get more performance for the 64bit output.
In the small example I get +20% for the CX 64bit release build and for my large project I get a lot more than 100% ...

Oliver, unfortunately one additional thing observed with the C runtime libraries both for XE8 and Seattle is that the math libraries are very, very slow. People have seen much better results by using the Delphi equivalents for things like sqrt (Delphi equivalent is System.Sqrt). Other math functions can be found in the Math unit (System.Math).

I hope this helps.
Oliver Weinheimer

Posts: 73
Registered: 8/20/04
Re: performance of 64bit output and other questions [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 26, 2015 6:42 AM   in response to: Sean Hoffman in response to: Sean Hoffman
Hi Sean,

I tested this for 64bit, release build, CX:

std::sqrt vs System::Sqrt -> no difference

std::power vs System::Math::Power -> System::Math::Power was 32 times faster than std::power

All in all I have to say that my large project is now around 3 times slower than compiled with XE7 and I even don't believe that XE7 produces fast code!

CX is not useable at the moment - that is more than anoying :-(

I hope the performance issues will be fixed with the next update

Oliver, unfortunately one additional thing observed with the C runtime libraries both for XE8 and Seattle is that the math libraries are very, very slow. People have seen much better results by using the Delphi equivalents for things like sqrt (Delphi equivalent is System.Sqrt). Other math functions can be found in the Math unit (System.Math).

I hope this helps.
Sean Hoffman

Posts: 126
Registered: 3/28/99
Re: performance of 64bit output and other questions [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 26, 2015 6:55 AM   in response to: Oliver Weinheimer in response to: Oliver Weinheimer
Hi Sean,

I tested this for 64bit, release build, CX:

std::sqrt vs System::Sqrt -> no difference

std::power vs System::Math::Power -> System::Math::Power was 32 times faster than std::power

All in all I have to say that my large project is now around 3 times slower than compiled with XE7 and I even don't believe that XE7 produces fast code!

CX is not useable at the moment - that is more than anoying :-(

I hope the performance issues will be fixed with the next update

Oliver, I completely agree about it not being ready for prime-time. The linker issues alone make it unusable. Sadly, I wish I could say this wasn't anticipated or expected (by me anyway). I think the update will fix a few things, and whatever's coming next spring/summer will improve some things even more (while breaking others at the cost of new features). It's a little hard for me to be bullish on the product at this point. As heretical as this must sound to long time Borlandites, in a perfect world, someone with deep pockets like Microsoft would have bought them out and not killed the products but instead spent the necessary development and QA resources to plug all the leaky pipes (or replace the broken plumbing).
Dale Chant

Posts: 13
Registered: 4/6/08
Re: performance of 64bit output and other questions [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 21, 2015 11:33 PM   in response to: Sean Hoffman in response to: Sean Hoffman
We had the same issue. See these posts:

http://community.embarcadero.com/index.php/answers/powl-bcc64-very-slow-in-xe5-xe6,-now-100-times-slower-in-xe7

https://forums.embarcadero.com/thread.jspa?messageID=667900&#667900
see last comment

Calling the Delphi math functions instead fixed all our performance issues - actually faster than Visual Studio, and faster than BCC32.

Sean Hoffman wrote:
Hi Sean,

I tested this for 64bit, release build, CX:

std::sqrt vs System::Sqrt -> no difference

std::power vs System::Math::Power -> System::Math::Power was 32 times faster than std::power

All in all I have to say that my large project is now around 3 times slower than compiled with XE7 and I even don't believe that XE7 produces fast code!

CX is not useable at the moment - that is more than anoying :-(

I hope the performance issues will be fixed with the next update

Oliver, I completely agree about it not being ready for prime-time. The linker issues alone make it unusable. Sadly, I wish I could say this wasn't anticipated or expected (by me anyway). I think the update will fix a few things, and whatever's coming next spring/summer will improve some things even more (while breaking others at the cost of new features). It's a little hard for me to be bullish on the product at this point. As heretical as this must sound to long time Borlandites, in a perfect world, someone with deep pockets like Microsoft would have bought them out and not killed the products but instead spent the necessary development and QA resources to plug all the leaky pipes (or replace the broken plumbing).
Alex Belo

Posts: 626
Registered: 10/8/06
Re: performance of 64bit output and other questions [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 26, 2015 11:46 AM   in response to: Oliver Weinheimer in response to: Oliver Weinheimer
Oliver Weinheimer wrote:

I hope the performance issues will be fixed with the next update

Performance issues is known problem in some last releases (you can find
QP reports on this theme). So "next update" looks too optimistic...

--
Alex
Oliver Weinheimer

Posts: 73
Registered: 8/20/04
Re: performance of 64bit output and other questions [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 3, 2015 1:46 AM   in response to: Alex Belo in response to: Alex Belo
Everyone who is interested in the performance problem with R10 should have a look at RSP-12769 (Quality Central, https://quality.embarcadero.com/browse/RSP-12769 and https://quality.embarcadero.com/browse/RSP-12229).
They use the clang 3.3 compiler with all optimizations off in R10! Another bad news is that it seems that it will not be fixed with Update 1.
So waiting for Update 2 / R11 begins ...

Edited by: Oliver Weinheimer on Nov 3, 2015 1:47 AM
Oliver Weinheimer

Posts: 73
Registered: 8/20/04
Re: performance of 64bit output and other questions  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 2, 2015 3:32 AM   in response to: Oliver Weinheimer in response to: Oliver Weinheimer
CX with Update 1 gives the following results:

64bit debug
XE7 : time: 4.477 sum: 6.66667e+11
CX : time: 0.717 sum: 6.66667e+11

64bit release
XE7 : time: 0.593 sum: 6.66667e+11
CX : time: 0.592 sum: 6.66667e+11

32bit debug
XE7 : time: 4.492 sum: 6.66667e+11
CX bcc32 : time: 0.499 sum: 6.66667e+11
CX bcc32c : time: 0.499 sum: 6.66667e+11

32bit release
XE7 : 0.592
CX bcc32 : time: 0.499 sum: 6.66667e+11
CX bcc32c : time: 0.499 sum: 6.66667e+11

At least the output for these few lines of code seems to be Ok now :-)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02