Consummation memory with QtQuick Compiler - memory

We intend to use QT5.9/QML in our commercial application, however we are worried about the memory consumption.
I read about QtQuick Compiler introduced in QT 5.8 which allows to compile QML source code into the final binary.
I wonder about the effect of QtQuick Compiler in commercial versions? did it bring a performance in memory consumption?
Is there an example of a commercial application before and after using QtQuick Compiler?

Related

FastMM reports 'Another third party memory manager has been installed' in BCB 6.0 & TeeChart 7.07

I've recently joined a new company with a suite of legacy apps written in C++ Builder 6 and am investigating some memory issues. To do this I'm using the latest Fast MM from GitHub and got it working ok with a simple BCB project.
In the actual projects, Fast MM says it can't start because 'Another third party memory manager has been installed'. After investigating this, it seems to be because of Teechart V7, which is used extensively in the projects.
If I add a Teechart control to my simple app I get the above message. We have the Teechart source code but I can't find anything in it that looks like a custom memory manager and am wondering if I can recompile it to use Fast MM. But, being a C++ Builder dev with very humble Delphi skills, I'm unsure if this is the right approach or why TeeChart causes Fast MM to think another memory manager is operating...
Any hints would be appreciated...
Andy
Teechart Pro V7 makes direct calls to the memory manager and building our app with runtime packages meant that TeeChart.bpl's dependency on the the Borland memory manager caused the problem. The simplest fix is to not include any Teechart package in the build with runtime packages list (assuming the linker can cope with the increased .EXE size) and/or use the third party ULink linker (ftp://ftp.styx.cabel.net/pub/UniLink/) which seems to cope with any size of deliverable.
Another option is to add FastMM to Teechart's projects (assuming you have the sources) and rebuild...

Compiler directive SETPEFlags in Deplhi 5

I have one application which is built using Delphi 5.0 and works fine without any issues. But when running large report my application needs more than 2 Gb memory. After doing analysis found that using Compiler directive SETPEFlags we can increase 32 bit application memory upto 4 GB.
I am trying to set in my program in Delphi 5.0 but getting error "Invalid Compiler Directive". Can somebody suggest any way to resolve without rebuilding application in other version. Or what version those got added to Delphi?
Thanks in advance.
You can't get the tools in Delphi 5 to mark your application as Large Address Aware ({$SetPEFlags} was added in Delphi 6). You need to add that PE flag as a post build setting. The usual way to set that flag is to use Microsoft's editbin tool.
Once you do this, your program will stop working as soon as you allocate memory beyond the 2GB boundary. That's because the default Borland memory manager does not support large addresses. You will need to replace it with FastMM or other LAA-capable memory manager. Or you can write your own replacement memory manager using, for instance, HeapAlloc(), if you wish.

If I am not using FastMM4 in full debug mode, is it any faster than the memory manager in Delphi XE2?

I use FastMM4, normally in full debug mode during development. If I turn off this mode should I arrange my app to go back to the Delphi (XE2) MM or is there a performance benefit in leaving FastMM4 linked all the time?
Delphi's memory manager (since D2007, IIRC D2006) is FastMM4, so you won't get any improvement in speed. The full FastMM4 might be faster, because you get improvements and bug fixes by using it straight from the source.

How do I turn on/off FastMM memory leak reporting under Delphi XE?

How do I turn on/off FastMM memory leak reporting under Delphi XE?
Under Delphi 7, I had to modify the inc file. But I hear that Delphi XE has FastMM already integrated. How do I access FastMM settings?
I got this from Delphi Help:
Full source code for the Memory Manager (FastMM) is available on SourceForge.
With the full version of FastMM, you can run the memory manager in a special "debug" mode which is useful for detecting heap corruption and memory leaks. Additional features in the full version of FastMM:
Double free objects / interfaces
File logging and reports
For more information, please see the comments in the FastMM source code(FastMM4.pas and FastMM4Options.inc).
So it looks like I still have to install FastMM manually. But do i have to include 'FastMM4' in project's USES clause?
You do it by assigning to the Boolean variable System.ReportMemoryLeaksOnShutdown.
This will allow you to control the single most important setting, the reporting of memory leaks. If you want more fine grained control of the FastMM settings then include FastMM in your project just as you did in Delphi 7.
If you download the full version of FastMM from http://sourceforge.net/projects/fastmm/
You have the option to disable a single memory leak and still keep the reports on other leaks that you do want to know about.
There's also a forum for FastMM that you might find helpful: http://sourceforge.net/projects/fastmm/forums
If you install FastMM, a uses clause for it will be automatically added to the relevant files. You can see this if you look at the .dpr file. If you remove the clause, FastMM will even add it back on recompile :-).

What should be tested in 64-bit Delphi

Delphi with 64 bit compilation is now in Beta, but only invited beta-testers will get their hands on this version.
What should be tested by the beta testers?
Embarcadero will probably provide a tester's guide for the beta testers. But, here are some ideas:
Memory allocation, alignment, heap and stack. 32-bit could use up to 4GB (well, 3.5) of address space on a 64-bit version of Windows with the /LARGEADDRESSAWARE switch: Delphi64 should be able to use much more. Try allocating 8, 16, and 32 GB. (Even if you have less RAM, the allocation should work since it's a virtual address space.) Now read and write values into it a certain spots: check your allocation and pointers all work. Have a look at what Process Explorer reports for the app. Inspect your stack: it runs top-down, unlike the heap - what does it looks like, what addresses is it using? What does the 16-byte alignment look like? Is that alignment kept for all internal Pascal functions, or only those that call external code? In the 32-bit VCL, there were some bits of code that weren't safe for addresses larger than 2GB. Have those been fixed? Does anything break when it's allocated in, say, the 53rd GB of your program's address space? (Try allocating a huge amount, and then dynamically creating forms, controls etc - they'll probably be created with high addresses.) Does the memory manager fragment? How fast are memory moves and copies?
Compiler warnings. (This one is important.) Upgrade your programs - compile them without changes, and see what warnings / errors you get; fix any; and then fix bugs that occur even though you weren't warned. What issues did you encounter? Should the compiler have warned you, but didn't? Do you get warnings when truncating a pointer when casting to an integer? What about more complex issues: if you use the Single floating-point type, what happens? Warning, or is it silently represented as a double? What if you pass in a parameter to a method that's a different size - for example, PostMessage and you pass in a 32-bit-sized value to the handle parameter - will the compiler be smart enough to guess that if the size is wrong, your code might be wrong, even though it's often valid to pass a smaller type to a larger parameter? Under what circumstances should it do so? (Another thing: what if you pass a 64-bit pointer to a 32-bit type in a method expecting a pointer to a 64-bit type - the type safety should yell loudly, but does it? A use case for that is reading blocks from a binary file, something that could easily cause problems with the wrong-sized types.) ...etc.
Compiler warnings are probably one of the most useful tools for people who upgrade, so the compiler should produce as many as possible, in as many situations as possible, with as few false positives as possible. Remember Delphi is used by a wide range of programmers - you may know what a warning means or recognize bad code even if the compiler is silent, but anything that will help novices (or good programmers having a bad day) is important.
Custom controls & WinAPI. You probably have a few customs controls or bits of code that make heavy use of Windows APIs instead of the VCL. Are there any Windows API-specific issues?
Language compatibility. Does the old file IO code work - AssignFile, etc? RTTI? If you have an event signature with an Integer type, and an event handler is auto-created by the IDE, is it generated as Integer or a size-specific integer type depending on the platform that's currently set? What if the event is NativeInt, what then? (I've seen bugs in event handler method signature generation before, though only on the C++ side.)
Different types of application. We can assume GUI programs have been tested well. What about console and service applications?
C++Builder compatible file generation. C++Builder won't be 64-bit in XE2, but hopefully will in XE3. Delphi can produce ..hpp and .obj files for Pascal code, though. What happens in for a 64-bit platform? Can you produce those files, even though they're useless? Does the compiler generate C++-specific warnings in 64-bit mode, or does it give up and not let you do it? In 32-bit mode, is there anything you can do for 64-bit compatibility that will generate a warning building the C++ header?
Linker. Can you link .lib and .obj files created with other compilers? (I'd expect .lib yes, .obj no.) Does the linker use COFF or OMF for 64-bit - have they changed? This thread implies an ELF format. Has it changed for 32-bit too? Does this affect the DCU format, will we still get ultra-fast compiling / linking?
COM and 64-bit plugins. Are there any marshalling issues? Can you build a 64-bit plugin for Explorer now?
Calling conventions. Safecall's supposed to be the only 'calling convention' (if safecall counts...) that's still different - does it still work? Function and procedure pointers, and closures (object method pointers): do they work? What do they look like in the debug inspector? Given all calling conventions are now the same, if you mix calling conventions in your method declaration and your calling pointer, what happens? Is there any legacy stuff around that will break or does it transparently work? Does it now give you an (erroneous) warning that the types are incompatible?
Floating point math. The Delphi 64 preview said floating point would be double only. Can Delphi handle long doubles? Are there any compatibility routines for handling the old Real (48 bits, I think??) type? Does the compiler generate SSE or SSE2 code or a mix, and how good is it?
Performance. This is their first go at a 64-bit compiler; it will probably be refined over the next few releases. But are there any obvious performance problems, with:
compiling; linking; IDE insight?
Generated code: are your programs faster or slower? Is FP math faster or slower? Does inline work, and does it generate any unnecessary header/footer bits around inlined methods?
Debugging. This is probably easiest to test through the whole process of testing everything else, but how well does the 64-bit debugger work? Does it have all functionality of the 32-bit one? Do IDE debug visualiser plugins still work? What if you debug a non-Delphi 64-bit program or attach to a process, instead of running normally?
Misc Is Delphi itself compiled as a 64-bit program? If not, why not? (Are they "eating their own dogfood"?) Code inspect the new VCL (assuming the preview comes with VCL source.) What have they done to make the VCL 32/64 compatible? Are there any errors, or if you already know 64-bit code well from other IDEs, are there better approaches they could take instead?
...etc. I could keep typing for hours, but I think that's a good start though :)
I'm sure Embarcadero will provide some testing guidance. For what it's worth this is what I'd test; Mostly because it's the stuff I care about:
Small console application should work.
Allows me to allocate a 4Gb flat hunk of memory. Don't really need that, but it will be the first thing my console application tries, right after WriteLn('I''m using all 64 bits!!!!');
Can create 64bit DLL and the DLL can be imported and used from other environment.
Do some simple things and look at the generated assembler, just for kicks.
Can create Firebird 64bit compatible UDF's
I'd probably try compiling my "utility" units, because they do an fair amount of pointer manipulation, see how they work.
If the VCL works I'd put it through it's paces: create small form, put a button on it, ShowMessage.
Generally speaking the only thing I really need 64bit Delphi for is Firebird 64bit UDFs. That's minor and can be "fixed" using FPC. I assume the best testing will be done by people that actually need 64 bit delphi. And those people don't need testing suggestions.
The base foundation stuff would come first, to ensure that Delphi 64 can be used for what Delphi 32 can't be used:
compiler correctness: first and foremost, no internal errors, no incorrect code-gen
ability to compile to 64bit DLLs and stability of those
stress the memory manager: with large objects, fragmented allocation, multi-threaded allocations, etc.
multi-threading: is it stable? is it efficient? does it scale? that for core RTL functions and units, and not forgetting the reference-counted types.
floating point: does the compiler deliver proper SSE? are the maths functions properly implemented and correct? what happens if you stress the SSE register set with complex expressions?
And as a bonus, ability to accept 64bit object files from the usual C++ compilers.
Non visual stuff ... I think. There is already success from some beta testers that already ported their libraries. I don't know the preview but from the information I don't have I would assume more complex non visual scenarios currently make sense. Anyone who knows it better please correct me ...
I think the preview first allows you to setup a migration strategy, this would be my intention. The VCL ... intended to work on one code base and maybe backport your code to purepascal instead of assembler.
Mike

Resources