Jump to content

David Heffernan

Members
  • Content Count

    3586
  • Joined

  • Last visited

  • Days Won

    176

Everything posted by David Heffernan

  1. David Heffernan

    Changes in Delphi from version to version?

    Knowing the version where things changed doesn't influence how you resolve the warnings
  2. David Heffernan

    Rapid generics

    That's not the same as starting from scratch. Also, didn't you have trouble with bugs in you asm code in your bigint library?
  3. David Heffernan

    Rapid generics

    Well, that's exactly what I have been arguing for. It seems utterly insane to me that this task is handled at runtime when it can be handled at compile time. Anyway, as I understand it the record dtor would run in addition to the RTTI based finalization code. So adding a dtor could only ever make code slower.
  4. David Heffernan

    Rapid generics

    True years ago, but these days not so. Just put some code through godbolt and marvel at the code that it generates. You don't have to get that complicated before you see the compiler spotting optimisations that are very far from obvious. Optimisers now have deep knowledge of hardware architecture and can use that to make choices that are beyond almost all human asm programmers.
  5. David Heffernan

    Issue closing external apps..

    That's because your button event handlers run busy message loops waiting for the child processes to finish. Your mistake is to run those busy loops in the main thread. You should consider running those loops in dedicated threads, and obviously remove the message processing. You code leaks the process handles and has other problems. Duplicating the code is a bad idea. You should be using CreateProcess to create processes. Fundamentally I would say that your main issue is that copying code without understanding it is a bad idea. You then become unable to maintain it and are unable to critique it.
  6. David Heffernan

    Rapid generics

    Why would we want to finalize records manually? What a terrible retrograde step.
  7. David Heffernan

    Rapid generics

    I don't much care what you like, or don't like. My point was that there exist plenty of compilers that can emit optimised code that is exceedingly efficient, and extremely hard to beat by humans writing code themselves.
  8. David Heffernan

    Rapid generics

    You mean language rather than compiler.
  9. David Heffernan

    Delphi permutation code complexity

    Can I ask why you are interested in complexity of this algorithm? If it is for the sake of learning, fair enough, but there are far better examples to teach you. If it is for a real application, complexity is the wrong question to ask.
  10. David Heffernan

    Rapid generics

    Very hard to find them though, and so easy to find good compilers.
  11. David Heffernan

    Rapid generics

    Practical for small amounts of code that is seldom modified. Of course good compilers typically produce better code than humans can manage.
  12. David Heffernan

    Rapid generics

    I'm not talking about the runtime. I'm talking about the code emitted by the compiler when it compiles my code. Performance is critical for my program. Some of the critical sections of code I translated to C in order to reap significant performance benefits of having a good optimising compiler. So yes, this is a real issue.
  13. David Heffernan

    Delphi permutation code complexity

    The complexity is linear with the number of digits. In this case it's probably much easier to write the code if you convert each number to text. You then need an array of counts for each digit. Count the digits. Finally check that each digit has the same number of occurrences. In practical terms, complexity arguments aren't actually going to be relevant here. It's the constant of proportionality that will matter most in performance.
  14. David Heffernan

    Rapid generics

    I see pretty much the same code in 10.3 as produced by XE7 in my real world app, using the Windows x64 Delphi compiler. Performance is identical. Still significantly worse than could be achieved by the mainstream C++ compilers. Probably worse than what could be achieved in C#!
  15. David Heffernan

    Rapid generics

    Runtime optimisation only helps if your code relies heavily on the runtime functions that have been improved. And where are these improvements in the code emitted by the compilers? I've not seen anything. What has changed?
  16. David Heffernan

    Rapid generics

    It's more complex than that. Maybe for users of System.Generics.Collections. But what about those of us that write our own generic types?
  17. David Heffernan

    Who is doing MacOS app with RadStudio for clients ?

    Is it the case that Delphi apps are still locked out of the app store because there is no 64 bit Mac OSX compiler?
  18. David Heffernan

    aItem := nil

    You never need to set a pointer to nil.
  19. David Heffernan

    aItem := nil

    You said that the objects were instantiated by calling the constructor. You later say that they are loop variables used when iterating over a collection. So that's a total contradiction. So, with this new information the simple answer is that you never need to set the loop variable to nil. We read the question just fine. Please don't tell us to read it again. It's you that should read it again.
  20. That's the not true part of what I am saying. There's also the not helpful part of what you stated. I found your comment to be entirely unhelpful.
  21. That's not true, and not helpful. The function can return anyrhing it likes. No reason where there has to be a field anywhere whose value is returned.
  22. David Heffernan

    Delphi inline and function evaluation

    Somewhat ironic that the output that performs worse is the one that you found impressive.
  23. David Heffernan

    Delphi inline and function evaluation

    C++ compilers are generally far better at optimisation than any Delphi compilers
  24. When facing terminology that you don't recognise I cannot recommend the use of websearch highly enough. https://enterprisecraftsmanship.com/2016/07/27/what-is-an-implementation-detail/ https://stackoverflow.com/questions/1777719/what-is-the-definition-of-an-implementation-detail And no, it's the second excerpt that relies on leaking implementation details, which is why it should not be used.
  25. David Heffernan

    operator overloding Equal vs Multiply

    Time to stop digging.
×