-
Content Count
3586 -
Joined
-
Last visited
-
Days Won
176
Everything posted by David Heffernan
-
Changes in Delphi from version to version?
David Heffernan replied to Ian Branch's topic in General Help
Knowing the version where things changed doesn't influence how you resolve the warnings -
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?
-
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.
-
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.
-
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.
-
Why would we want to finalize records manually? What a terrible retrograde step.
-
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.
-
You mean language rather than compiler.
-
Delphi permutation code complexity
David Heffernan replied to Roberto Dall'Angelo's topic in Algorithms, Data Structures and Class Design
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. -
Very hard to find them though, and so easy to find good compilers.
-
Practical for small amounts of code that is seldom modified. Of course good compilers typically produce better code than humans can manage.
-
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.
-
Delphi permutation code complexity
David Heffernan replied to Roberto Dall'Angelo's topic in Algorithms, Data Structures and Class Design
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. -
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#!
-
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?
-
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?
-
Who is doing MacOS app with RadStudio for clients ?
David Heffernan replied to Rollo62's topic in Cross-platform
Is it the case that Delphi apps are still locked out of the app store because there is no 64 bit Mac OSX compiler? -
You never need to set a pointer to 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.
-
What is meant as 'implementation detail' vs 'non-implementation detail'?
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
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. -
What is meant as 'implementation detail' vs 'non-implementation detail'?
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
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. -
Delphi inline and function evaluation
David Heffernan replied to Mahdi Safsafi's topic in Tips / Blogs / Tutorials / Videos
Somewhat ironic that the output that performs worse is the one that you found impressive. -
Delphi inline and function evaluation
David Heffernan replied to Mahdi Safsafi's topic in Tips / Blogs / Tutorials / Videos
C++ compilers are generally far better at optimisation than any Delphi compilers -
What is meant as 'implementation detail' vs 'non-implementation detail'?
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
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. -
operator overloding Equal vs Multiply
David Heffernan replied to Eugine Savin's topic in RTL and Delphi Object Pascal
Time to stop digging.