-
Content Count
1518 -
Joined
-
Last visited
-
Days Won
154
Everything posted by Stefan Glienke
-
I know english is not your native language but to be honest just throwing around numbers and all kinds of different benchmarks it totally confusing for me - it would be very helpful if you could present your findings in a more structured way as I really find the topic interesting but it is very exhausting to follow you.
-
Thanks, might be worth putting that info into the github readme because right now this looks like the Sea*.dll are yours where no code nor their source is found for in the repo. Also apart from the raw speed numbers do you have total/peak memory allocated comparisons for the tests you mention as well? Edit: what is the "FastMM5 benchmark utility" you referring to? I see no benchmark in the FastMM5 repo
-
X is n times faster than Y is not leading anywhere unless you profile the bottleneck of Y in your benchmark. Run it under VTune or uProf and report your findings. As for your MM it might be faster but nobody serious will download and use some random dlls (that are not even signed) from the internet and put them into production.
-
Automated Way to Detect Interface Breaking Changes
Stefan Glienke replied to Larry Hengen's topic in General Help
Unless you use generics - they are off limits to be changed (interface and implementation section) in both cases - also for units inline methods are off limits - for packages they are ok because inlining does not happen across binary module boundaries. -
Generic circular buffer library released
Stefan Glienke replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Keep in mind this was addressed at Uwes comment that he did not publish something similar because he did not make the effort to make it work not only for his but as a general purpose thing. I cannot speak for others but for me it was reading a lof of collection library code (not only Delphi) - the Delphi specific things (can/cannot use System.Move and such) comes from general core runtime (RTL) knowledge. And sometimes after years it dawns on you that naive usage of generics in large OOP architectures is not the greatest thing and you start refactoring stuff. -
Generic circular buffer library released
Stefan Glienke replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Simple: pointers stored in the weakref table in System don't match those after using Move -
Generic circular buffer library released
Stefan Glienke replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
I disagree - if this implementation were done totally naive it would have actually worked for any T yet in a non optimized way - but the author tried to be clever by using Move 😉 Leave implementing generic collections to people experienced with it (which I in no way claim to have monopoly on) P.S. Since the XE7 refactoring disaster of System.Generics.Collections which still has existing bugs as aftermath I am very sensitive regarding this topic. -
Generic circular buffer library released
Stefan Glienke replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
I admit - it's not common but good luck storing something like this in your list then: type TMyRecord = record [weak] something: IWhatever; end; I am not bashing any code here but when something is published as general purpose use (which an unconstrained generic collection class is) then I expect it to work for any T. If you don't handle this in your private code because you don't have such use case you of course don't need to care. As for TRingBuffer<T> - it leaks strings for example: var b: TRingbuffer<string>; begin b := TRingbuffer<string>.Create(8); b.Add('one'); b.Delete(1); b.Add(['two', 'three']); b.Free; end; -
Generic circular buffer library released
Stefan Glienke replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Read System.Collections.Generics. Particularly the places where it checks for HasWeakRef(T) What weak references are and how they are handled and why you cannot simply System.Move them refer to System.pas (start with RegisterWeakRef) -
Generic circular buffer library released
Stefan Glienke replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
No, yes For managed types you can System.Move them in the internal array - however it also does it when peeking x items into the result array. For types containing weak reference System.Move does not work even for the internal array. -
Generic circular buffer library released
Stefan Glienke replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Spring4d 2.0 already has this: https://bitbucket.org/sglienke/spring4d/src/c336b8dd39bfc30cbcf2fa1f6d8323e663bdcc05/Source/Base/Collections/Spring.Collections.Base.pas#lines-473 It is an abstract base class (you don't simply use that one) implemented by several different ready to use collections such as queue, deque, boundedqueue (does not grow like queue does), evictingqueue (drops the oldest element when full) TRingbuffer<T> unfortunately has several defects, mostly around simply using Move regardless the type of T (managed, containing weak reference) -
SynEdit replacement for Delphi 10.1 Berlin / editor wanted for source code (not Delphi)
Stefan Glienke replied to Mr. Daniel's topic in VCL
What you refer to is called forking and in fact GitHub is able to track what repositories are a fork and where they originate from. The problem is a different one and that is that often forks are more active than the original one which at some point might be completely inactive. If I were someone actively working on a fork while the original project might be dead I'd reach out to the original maintainer/author and try to work something out. -
Boolean short-circuit with function calls
Stefan Glienke replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Yes it is - optimizer does not reorder. If it would short-circuit evaluation would be broken. FWIW setting Result to False and or'ing it with A is unnecessary - x or False = x -
Boolean short-circuit with function calls
Stefan Glienke replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
That code does not compile, method references cannot be declared as consts. What you probably meant was this: const Funcs: array[0..2] of function: Boolean = (A, B, C); And yes, that only works if they are parameterless otherwise you would have to declare that differently - but again only works if they are have homogeneous signatures. Talking about possibly overengineering: https://en.wikipedia.org/wiki/Specification_pattern -
Boolean short-circuit with function calls
Stefan Glienke replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Conditionals probably but certainly not switches. -
Boolean short-circuit with function calls
Stefan Glienke replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
And what exactly is wrong or not understandable in a week with using {B+} and a simple one liner? -
System.GetMemory returning NIL
Stefan Glienke replied to dummzeuch's topic in RTL and Delphi Object Pascal
They do by possibly specifying a capacity when creating one. Should I depending on that number either call SetLength which uses GetMem or allocate the dynamic array memory buffer myself? I would rather like to avoid that because that might get quite complicated when we are talking about resizing. That is what I was aiming at - making claims of how x is bad and y is better is all good and sound but what are the concequences for developers that want to benefit from these potential benefits - or does it not matter at all. -
August 2020 GM Blog post
Stefan Glienke replied to Darian Miller's topic in Tips / Blogs / Tutorials / Videos
The alternative to Italic... scnr -
System.GetMemory returning NIL
Stefan Glienke replied to dummzeuch's topic in RTL and Delphi Object Pascal
As a library developer I have this question after reading all this: how does this affect me. For example collections are an essential part of spring4d and they can be of any capacity from just a few items which fit into a small block up to collections that hold thousands of elements and where SetLength causes the used GetMem to use large blocks. So if anyone claims that the way the MM does it is not good the solution for many places that allocate variable size of memory is not to put if size < x then getmem else virtualalloc but to solve this properly inside of GetMem/the memory manager. Especially since GetMem is indirectly called by many things such as SetLength - if you directly allocate memory for your own sure you can choose one or the other. -
System.GetMemory returning NIL
Stefan Glienke replied to dummzeuch's topic in RTL and Delphi Object Pascal
Yes some are written to disk but usually not commonly used memory - especially not when there is plenty of RAM available. The article even says: -
System.GetMemory returning NIL
Stefan Glienke replied to dummzeuch's topic in RTL and Delphi Object Pascal
Look into the implementation of System._GetMem and compare that with System.GetMemory and you know the answer. -
Why should I use good source control versioning system?
Stefan Glienke replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
Not sure you missed or ignored it but I'll throw this in here for completeness and because it's free: Git Extensions. -
IDE plugin to remove Explicit* from .dfm files
Stefan Glienke replied to Tommi Prami's topic in Delphi IDE and APIs
You either keep wondering or you simply google it and find this for example: https://stackoverflow.com/a/2477026/587106- 7 replies
-
- ddevextensions
- ide
-
(and 3 more)
Tagged with:
-
IDE plugin to remove Explicit* from .dfm files
Stefan Glienke replied to Tommi Prami's topic in Delphi IDE and APIs
Ask him nicely how you can help him get it out for 10.4 and maybe he'll do.- 7 replies
-
- ddevextensions
- ide
-
(and 3 more)
Tagged with:
-
IDE plugin to remove Explicit* from .dfm files
Stefan Glienke replied to Tommi Prami's topic in Delphi IDE and APIs
DDevExtensions does it indeed.- 7 replies
-
- ddevextensions
- ide
-
(and 3 more)
Tagged with: