Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 12/07/23 in all areas

  1. Anders Melander

    Delphi 12 is available

    I have a client who wants to use DWScript to do structural load analysis of large models (thousands to millions of nodes). Since DWScript compiles to an AST (Abstract Syntax Tree) and then executes the objects in that tree, he was a bit concerned about performance. He had tried various other scripting systems and they were just too slow. So we did some benchmarking of a sequence of typical calculations in Delphi vs DWScript. As expected the Delphi compiled code was about 4 times faster than DWScript. The client thought that that was acceptable but I decided to try out the DWScript jitter anyway... As it turns out there might just be something to David's complaints about Delphi's math performance 😉 because with the jitter enabled DWScript was now more than twice as fast as the native Delphi code. Also, Delphi 64-bit was about 25% slower than 32-bit and 64-bit "optimized" was slower than "unoptimized". Not to take anything away from Eric Grange's amazing work on DWScript, but I would be embarrassed if my native code compiler was outperformed by a scripting system.
  2. Stefan Glienke

    Delphi 12 is available

    You do realize that Java and C# are not interpreted like Python, yes? They compile down to machine instructions but not at compile time but at runtime - hence the term JIT. And fwiw the code that these JIT compilers produce often runs circles around what Delphi does with its ancient instruction set the compiler knows of. I am getting tired of that mantra "But it compiles to native code!" as if that in itself was something good. If that native code is poorly optimized and mostly looks the same as in '95 or compiled with -O0 then how good can it be?
  3. Anders Melander

    Delphi 12 is available

    This place isn't representative. Most developers don't participate in communities and don't even know they exist. I've worked at a lot of different places and with a lot of different developers in my career and I think I've only ever met one other developer IRL that participated in communities. Not that I can see. My experience with Lazarus/FPC is limited to using it to make some open-source projects FPC compatible but from my POW they are constantly playing catch up with Delphi. And I think Lazarus sucks as an IDE.
  4. Lars Fosdal

    Delphi 12 is available

    FreePascal's Generics support is pitiful. It is impossible to move my Delphi code to FPC.
  5. I don't know what to think after reading that article. Here are my comments on it: - the classic way of truncating the last 2 digits with div and mod 10 (or 100) does not involve a costly div or mod instruction on modern compilers (*cough* even Delphi 12 now does it - apart from the bugs that came with it) - I think C++ compilers would detect doing a div and a mod instruction and the code they emit would be further optimized so it does not require the "workaround" that the Delphi RTL uses by calculating the modulo by subtracting the div result times 100 from the original value. - the pseudo-code he shows for detecting the number of digits is correct but this is never what gets executed - and you either rewrite this into a few branches (as you can see in the RTL), a C++ compiler might unroll the loop or some other trickery is applied The DivBy100 function was introduced by me in RSP-36119 and I already notified them that DivBy100 can be removed in 12 because now it properly optimizes a div by 100 - however, that affects performance only by like 0.5% or so. As David correctly pointed out the real bottleneck is the heap allocation - and not only a single one when you just turn an integer into a string and display that one but when you concat strings and numbers the "classic" way because then it produces a ton of small temporary strings. That issue even exists when using TStringBuilder where one might think that this was built for optimization. If you look into some overloads of Append you will see that it naively calls into IntToStr and passes that down to the overload that takes string. This is completely insane as the conversion should be done directly in place into the internal buffer that TStringBuilder already uses instead of creating a temporary string, convert the integer into that one, pass that to Append to copy its content into the buffer. This will likely be my next contribution as part of my "Better RTL" series of JIRA entries.
  6. DelphiUdIT

    Delphi 12 is available

    I wouldn't consider Delphi as legacy software. It is one of the few environments that produces native code, and if on the one hand this method is considered "old", on the other it offers priceless advantages. For the work I do, where longevity of applications is necessary (I deal with artificial vision in the industrial field), Delphi is perfect. Same program used by machines starting from Windows 7 up to the current 11, without intermediate frameworks that only complicate the distribution and maintenance of applications. The ease with which modern environments approach programming (see Python one for all) completely overrides the knowledge and skills of a programmer, making this world APPARENTLY simpler and more banal than it is. It is obvious that young people approach, for example, Python or Java rather than Delphi for certain types of applications (typically WEB) where with a few lines of code I have built an app that "runs" on the web. On C#, in my opinion a language between Pascal and JAVA, the choice is certainly oriented by a strong demand on the market driven by the commercial power of Microsoft which certainly makes this language more attractive for young people. And I continue, like many other companies from what I see in the various meetings both in proximity and in webinars, to develop new applications with Delphi (and with C++ for some peculiar hardware functions). I use Lazarus/FPC to support an Italian forum, but the environment, although declared universal and compatible with all available hardware and OS, is far from this dream. The IDE is also far from those of Delphi in terms of features and functionality and even the basic components provided are limited, relying completely (or almost) on third-party packages. The RTL support is incomplete, the generics are actually not usable, there is no support for themes / styles, the debugger (made entirely in Pascal) despite being more stable than Delphi's is still very crude and limited on some functionality. Last but not least, one of the big gaps is the documentation: for a beginner, finding exhaustive documentation on Lazarus/FPC is a challenge. Delphi uses the documentation created and updated over time starting from Borland and in my experience it is second only to the "exterminated" former Microsoft KB (also new environments like Android Studio have good documentation). Lazarus/FPC's strong propensity to "generalize" itself across a variety of OSes means that many features typical of a specific operating system (I'm talking about Windows in my case for example) are not available or exposed. An advantage to be attributed to it is that for Linux lovers the IDE is also available in their beloved OS.
  7. The biggest issue with the Delphi code is that it forces heap allocation on you which is the real bottleneck.
  8. Sherlock

    Delphi 12 is available

    I love the possibility to create and sell a monolithic exe, that can be dropped in a folder and just be executed, no installer necessary. That is of course not a distinguishing feature of Delphi, you could compile a C# application into a monolithic exe as well, but how often is that really done?
  9. DelphiUdIT

    Delphi 12 is available

    ... of course I'm aware .... It was a ironical replay to @David Heffernan ... Mantra "But it compiles to native code!" is a must for my business, may be only for me but that's enough. I have customers with dozens of machines (industrial lines) who are tired of hearing about frameworks that must be constantly updated, incompatibilities between functional blocks (effectively DLLs and third-party components) with each update, technology changes for "opportunities" of suppliers (for example instead of working with .Net 4.0 there is now .Net CORE x.x) which make many solutions adopted on old machines incompatible with the new ones. We are not talking about Java applications linked to a specific JRE which due to their "incorrect" development cannot be selected from the application itself (so if there are multiple JREs installed... nothing works). The customer who does not have "programming" as his core business but only the use of an IT product is not interested in the outline at all... he is only interested in not having any kind of problem in using it for the next few years. This is. How much the machine code is optimized is not a problem for my applications, or at least what optimization there is is sufficient. If I want optimized and performant code I use C or C++ (as already indicated)...
  10. PeterPanettone

    Delphi 12 is available

    Using third-party products like https://www.devexpress.com/products/vcl/, it is possible to build very sophisticated VCL applications.
  11. pmcgee

    Removing String

    Well. I learnt about something today. Recursive regexes.
  12. Rinzwind

    Delphi 12 is available

    It's pretty clear Delphi is considered Legacy. It's only used for classic styled Windows software using the old GUI 1995 paradigms. We only see the same people here. No new and fresh people. Any new project that needs Pascal for whatever reason, I would do with Lazarus/FreePascal. Seems there is more progress over there. The global state of software development is in a sad state compared to 5e high days of the '90s. The efficiency of VB6 and Delphi 6. The RAD experience. The other specific database tools available. Foxpro. Now we have web apps with a zillion layers and frameworks that change every 1.5 years. Keep busy learning stuff that's out of date soon. Is there even any decent review out there of Delphi 12? I wonder what the boys and girl of FL Studio are thinking. That is one piece of complex and impressive software. Do some hang around here?
  13. David Heffernan

    2 new programs

    Why wouldn't people just use standard libraries and tools for this?
  14. weirdo12

    FireDAC SQLite MetaDefCatalog

    https://docwiki.embarcadero.com/RADStudio/Athens/en/Preprocessing_Command_Text_(FireDAC)
  15. Uwe Raabe

    Delphi 12: Install Packages inconsistency?

    Actually that looks like a reason to keep the current behavior instead of implementing the proposed one:
  16. Lars Fosdal

    Removing String

  17. David Heffernan

    Delphi 12 is available

    I don't care that much about the IDE. It's the compiler and the language that matters more to me.
  18. David Heffernan

    Removing String

    Your specification in the original post is incomplete so it's not surprising that people don't know what you want. Your clarification is still unclear. Until you can define precisely what you want the code to do how could you expect anyone, even yourself, to be able to write it.
  19. Vandrovnik

    FirebirdSQL 4 (64bit) Performance

    Hello, I suppose you have to test it yourself, because "it depends". Some usefull tips: https://ib-aid.com/en/articles/45-ways-to-speed-up-firebird-database/ https://ib-aid.com/en/articles/23-more-ways-to-speed-up-firebird/
  20. PeterBelow

    FirebirdSQL NaN value for numeric field

    TField.IsNull is the way to check if a database field is NULL. Do not rely on this conditions beeing mapped to a specific value.
  21. Dalija Prasnikar

    Delphi 12 is available

    I think it got a bit further... we are somewhere in the Dark Ages...
  22. PeterPanettone

    Delphi 12 is available

    Many handicaps are corrected by plugins such as GExperts and/or CnWizards. Without these plugins, Delphi would be unusable for me - at least in bigger projects that go beyond the simplest use cases. On the other hand, the editor contains some valuable gems, such as the replacement of identifiers in a selection. A big thank you must also go to developers like Thomas and the Chinese team of Liu Xiao, without whom, in my opinion, Delphi would not exist in its current form. I believe the next big step in Delphi should be a built-in source editor like UltraEdit and Visual Assist for Delphi. That would make Delphi a real luxury IDE. The designer should also cut out some old habits, such as the dual-use structure panel (that should be replaced by separate structure panels for the Designer and the Source Editor).
  23. Using 10.4 you can do this with the following code: TArray.Sort<yourtype>(list.PList^, list.Comparer, index, count);
  24. You didn't mention the Delphi version, but since Delphi 11 you can use the appropriate Sort overload taking a comparer, start index and count. procedure Sort; overload; procedure Sort(const AComparer: IComparer<T>); overload; procedure Sort(const AComparer: IComparer<T>; Index, Count: Integer); overload;
  25. Stefan Glienke

    TArray<T> helper

    GNU License 🤦‍♂️ Some of the methods in that helper are obsolete since XE7 because we have Insert, Add, Delete for dynamic arrays. Most of the other methods are in Spring.pas TArray which is not a helper for the System.Generics.Collections one but reimplements its methods and adds its own. For the TArrayRecord<T> type Spring.pas has Vector<T> (the naming is taken from C++ where this is the dynamic array type name)
×