Jump to content

Stefan Glienke

Members
  • Content Count

    1518
  • Joined

  • Last visited

  • Days Won

    154

Everything posted by Stefan Glienke

  1. 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)
  2. Stefan Glienke

    Micro optimization: Math.InRange

    Indeed here it's the opposite, due to the way it's written it always has to perform both checks (see my third point). But depending on what you do after the if it could be done completely branchless.
  3. Stefan Glienke

    Micro optimization: Math.InRange

    While your assessment on Math.InRange is true (it is coded in a bad way plus the compiler produces way too many conditional jumps - https://quality.embarcadero.com/browse/RSP-21955) you certainly need to read some material on how to properly microbenchmark and how to read assembly. First of all, even though the Delphi compiler is pretty terrible at optimizing away dead code it might omit the if statement if there is nothing to do after it. Second - be careful if one of your loops spans multiple cache lines while others don't this affects the outcome slightly and can in such a case affect the result in a noticeable way. Third - with a static test like this you prove nothing - the branch predictor will do its job. If you want to benchmark the raw performance of one vs the other you need to give it random data which does not follow the "not in range for a while, in range for a while, not in range until the end" pattern
  4. An impressive number of implemented collections for sure but it's only compatible with FreePascal and from a quick look you won't easily make that code Delphi compatible. But thanks for mentioning it - I will certainly run some benchmarks to compare.
  5. @Dany Marmur Agreed - it's the job of runtime library developers to get the most out of their data structures and algorithms so the users of those libraries don't have to worry 99.9% of the time but just chose the reasonable type/algo for the job. Funny enough I am currently in the process to do exactly that for my library and can tell you that for the RTL it's certainly not the case, unfortunately.
  6. Stefan Glienke

    Is set a nullable type? (record constraint)

    No version ever compiled this code - I just checked with XE8 to 10.4 (all the latest update/hotfixes) Reported since 10.0.1 - see https://quality.embarcadero.com/browse/RSP-13198
  7. And then after you spent quite some time implementing this without defects that it would not be any faster than all the ready-to-use collection types or the actual performance improvement would be completely negligible.
  8. Stefan Glienke

    Do bug fix patches really require active subscription?

    @Remy Lebeau Selective perception? If a compiler is not a critical product function I don't know what is.
  9. Stefan Glienke

    Do bug fix patches really require active subscription?

    I think at least in Germany the court would say otherwise - keyword: Nachbesserung und Gewährleistung
  10. pcg32 should be easy enough to implement from the c code.
  11. Stefan Glienke

    Several F2084 Internal Error on Delphi 10.4.2

    That's what QA said before 10.4.2 released
  12. Stefan Glienke

    Several F2084 Internal Error on Delphi 10.4.2

    Or he just wants to see the correct values when inspecting them while debugging?
  13. Stefan Glienke

    Find exception location from MAP file?

    No need to assume or guess anything - the base addresses are in the map file.
  14. Stefan Glienke

    generics collections and containers

    What type of collections do you have in mind? Not all types of collections can be implemented completely lock-free in an efficient way or they are hilariously complex to implement. Depending on the implementation some operations might not have the same characteristics of a regular thread-unsafe implementation.
  15. Stefan Glienke

    Several F2084 Internal Error on Delphi 10.4.2

    No, we are not - some individuals who also happen to be MVP are.
  16. Stefan Glienke

    Pos

    LSP has nothing to do with that but the filter in the suggestion box. There were several plugins that could do that for ages.
  17. Stefan Glienke

    What about additional free open source C++ libraries on GetIt ?

    Because what percentage of overall C++ development is being done in Visual Studio again?
  18. Stefan Glienke

    Display Componant like Gauges Led and Graphic for Delphi FMX

    https://choosealicense.com/ is also a good help to decide which one to pick.
  19. Stefan Glienke

    What about additional free open source C++ libraries on GetIt ?

    Nuget is for .Net, not for C++. C++ has a bunch of package managers but none of them is considered the de facto standard that almost everyone uses.
  20. Stefan Glienke

    Display Componant like Gauges Led and Graphic for Delphi FMX

    This: This means it will be basically useless for commercial projects.
  21. Stefan Glienke

    64bit Debugger Not Handling Memory Problems

    That dialog there is definitely not from the debugger. Make sure you did not accidentally disable breaking on exceptions.
  22. Stefan Glienke

    RegEx performance

    Opinions on regex differ - however for this case using a regex is like using a bucket-wheel excavator to plant a pansy.
  23. Stefan Glienke

    RegEx performance

    Just skip any spaces and then check if it's '(' or not: function IsFunctionInString(const aFunction, aStr: string): boolean; var vPos: Integer; p: PChar; begin vPos := Pos(aFunction, aStr); if vPos > 0 then begin p := @aStr[vPos + aFunction.Length]; while p^ = ' ' do Inc(p); Result := p^ = '('; end else Result := False; end;
  24. Stefan Glienke

    Forum for Spring4D

    But what if I would not answer there 😉 Seriously - I understand people getting their area here if they don't have their own place already - Spring4D already has its own place.
×