Hello guys
Hello guys,
I tried to replace the default Collections from Delphi to Spring4D in a project, for the benefit of using interfaces and more powerful collections methods, but the dcu units increased greatly in size.
In my tests, replacing all to Spring4D collections, in a project with about 120 units, in Delphi XE8, a build all often generates an out of memory in IDE.
I made a small project example to show the problem.
Should not the Delphi IDE/Compiler be able to handle projects with heavy use of interfaces better?
/embarrassing
ReplyDeleteThe out of memory error is all too frequent in XE7, even without heavy use of interfaces.
ReplyDeleteAnd you used the latest version of Spring, taken from trunk of their repo?
ReplyDeleteDephi is becoming more and more silly, if you make a BPL, just referencing any pas in the BPL, and the entire BPL will compile . So EXE will be very very larg.
ReplyDeleteI would not say that Delphi is becoming silly, but that term would apply to many of the rationales which have been given in recent years for the errors remaining unfixed.
ReplyDeleteThe last time I bought my own license was for XE, which was at least fairly stable. Not likely ever to buy another, as the value falls well short of the price, in my view.
Of course, being in the US, where the population of Delphi developers is small and shrinking, my views may be at odds with those of my European colleagues.
David Heffernan yes, downloaded about two weeks ago
ReplyDeletetry it again with TCollections.CreateXYZ() instead of using the type directly.
ReplyDeleteIt's not a problem of interfaces but of generics that they don't get under control: https://quality.embarcadero.com/browse/RSP-18080
ReplyDeleteDoesn't IDE Fix Pack address this issue?
ReplyDeleteNo, IDE FixPack fixes some issues in the compiler (more precisely the compiler fix pack) regarding performance but it never changes the output of the compiler in any way.
ReplyDeleteStefan Glienke I meant the out of memory problem of the IDE
ReplyDeleteAgustin Ortu I'm using IDE Fix
ReplyDeleteMartin Wienold same think
Stefan Glienke The System.Generics.Collections also makes use of generics and dcu's looks fine
Rafael Dipold Because:
ReplyDelete1. TDictionary from System.Generics.Collections has a very simple class hierarchy and dependency. The one from Spring basically contains all other types. You can use any operation from IEnumerable>, IEnumerable (via its Keys property) and IEnumerable (via its Value property). All these operations have dependencies on the iterator classes (for example Where).
2. because everything is behind an interface. The linker cannot strip out all the methods that you did not use.
3. mostly because of the of the issue I linked earlier. If you look into the generated dcus you can see many types being referenced there that you (or some code you called) never used.
FWIW some time ago I blogged about the several problems with generics (binary bloat being one of them): http://delphisorcery.blogspot.de/2014/03/why-delphi-generics-are-annoying.html
Interface helpers would solve much of those problems imo because then the interface would have to be so fat and thus the classes behind them could be smaller reducing the binary size. Helper methods could probably better stripped by the linker (so far for the theory).
Vote for it:
https://quality.embarcadero.com/browse/RSP-16763
https://quality.embarcadero.com/browse/RSP-10336
Very nice... voted!
ReplyDeleteAgustin Ortu One or more compiler memory issues are addressed in DDevExtensions, specifically in the "Compilation" section. Not sure how effective they are, though
ReplyDelete