Presentation is loading. Please wait.

Presentation is loading. Please wait.

C++Builder 10.2.3 Existing user? Migration and Performance David Millington C++ Product Manager, Embarcadero.

Similar presentations


Presentation on theme: "C++Builder 10.2.3 Existing user? Migration and Performance David Millington C++ Product Manager, Embarcadero."— Presentation transcript:

1 C++Builder Existing user? Migration and Performance David Millington C++ Product Manager, Embarcadero

2 Recent C++Builder Clang compilers Performance improvements
The recommended toolchain Language features Performance and codegen Performance improvements

3 1. Clang compilers Clang – history Language features

4 Clang compilers Bcc32: classic compiler, C++98/03
Since XE2, new toolchain based on Clang Why? Modern C++: C++11 and newer Better template handling LLVM codegen

5 Clang compilers Start with Clang Add out extensions (there are many!)
Get a great C++ compiler with improvements, so ‘Clang-enhanced’ Then roll out platforms: XE2 (eight versions ago): Win64 Now: Win32, Win64, iOS32, iOS64, Android, soon Linux and macOS64 Roadmap: Clang 4/5, C++17

6 Clang compilers Many users still use classic bcc32
Clang is where we recommend you move! How easy is it? Easy. I’ve done it Clang compilers stricter on language Informative error messages All differences – and they’re minor – are documented! Do it once. Take the time and reap the benefits

7 Clang compilers: migration
More (and better) error messages Stricter code Minor compiler differences

8 Migration #1: Better error messages
int add(const int a, const int b) { return a + b; } int foo(const int a) { return add(add + (1 * 2), (3 * 4)); } ^ error here Bcc32 message: main.cpp(16): E2453 Size of the type 'int(const int,const int)' is unknown or zero main.cpp(16): E2034 Cannot convert 'int(const int,const int)' to 'int' main.cpp(16): E2342 Type mismatch in parameter 'a' (wanted 'const int', got 'int (*)(const int,const int)') Clang gives a better message: main.cpp(16): arithmetic on a pointer to the function type 'int (const int, const int)'

9 Migration #1: Better error messages
int add(const int a, const int b) { return a + b; } template<typename T> double dosomething(const T d, const T e) { return d + e + add;} ... dosomething<double>(1, 2); Bcc32 message: [bcc32 Error] main.cpp(20): E2060 Illegal use of floating point Clang gives a better message: { return d + e + add; } ^ error here main.cpp(20): invalid operands to binary expression ('double' and 'int (*)(const int, const int)') main.cpp(24): in instantiation of function template specialization 'dosomething<double>' requested here

10 Migration #2: stricter code, #3 compiler diffs
Some bad code that is accepted now is not More standards compliant Stricter conversions Can’t mix __try with catch (try/catch, and __try/__except__finally) Some project options Templates use 2-phase lookup o/en/Clang-enhanced_C++_Compilers

11 Clang compilers – what do you get?
Much better C++ language support: ‘modern C++’ Lambdas, move semantics, type inference (auto), range-based for loops, constructors delegate to others, strongly typed enums, template >> problem solved, initialiser lists, tuples, two great smart pointers (don’t use boost any more!), etc. The code you write is better, clearer, smaller, safer, more powerful. Optimizations and performance Compiled app is better Code sample of old vs new code…

12 2. Clang performance Performance Comparison demos

13 Performance and codegen
Clang-enhanced compilers use LLVM More optimisations Compiled code can be 2x faster Users in scientific, engineering, and other areas: performance is important C++ is a language known for performance! Use the modern toolchain Code sample showing difference…

14 Thank you! Questions and Answers


Download ppt "C++Builder 10.2.3 Existing user? Migration and Performance David Millington C++ Product Manager, Embarcadero."

Similar presentations


Ads by Google