Jump to content

Tommi Prami

Members
  • Content Count

    592
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by Tommi Prami

  1. People tend to forget things. Right? As I recall ChatGPT gave virtually identical code also, but does not change the fact that I messed up... (EDIT: What I tried to say with that ChatGPT thing wea that I think (if recall) made ChatGPT implementation first. Checked out the API calls made, Google search and found the Grahics32 implementation and went with that. I think I had no intention to make the reposiotory public of that extracted version. As I was just testing the effect of the performance cores only thing out of curiocity, but at some point thought that mayeb some one also would like to use that. At that point most likely did not even think of the origin of the code any more. etc. I should have, for sure. Would not like to hijack more this thread on this, hope all is good now as the license is changed and added reference to the oigin, make issue on the project if something else is needed to fix)
  2. Is there Lock free or Thread safe containers in Sping4D... Asking for a friend 😉 -Tee-
  3. At least in my case, I ran 7-Zip processes in parallel, windows did piss poor job of allocating those prcesses to perdormance cores. Anyones mileage migh vary for sure.
  4. It is mostly from there. I think. I thought I made it clear in code or GitHUB, let me check. I think I found few starting points, when searching the solution for the problem. If you’re referring to what I said earlier, that I did write it. I honestly did no longer remembered where it originally came from. I’ll make sure to give credit to the project. In other words, I had no intention of taking credit for something that isn’t mine. -Tee-
  5. Helllo, Depending on your CPU, you might need to set Affinity mask for the threads. If you have new Intel CPU with P and E cores you get wildly different results depending on which core threads are running at. Made siple unit top get Affinities: https://github.com/TommiPrami/Delphi.ProcessAffinity.Utils If you use it and find bugs, please make pull reguest. -Tee-
  6. Tommi Prami

    Rapid.Generics revamp

    Could you please make the benchmark results like in the original version has. And possibly add the original into the mix, so can see how much the bugfixes ads overhear, correctness sometimes sadly has some penalty 😉 But anyhow, would be good addition.
  7. Tommi Prami

    OtlParallel Memory Leak

    He was most likely talking to me, not to you, but he started it ans for sure not been insulting everyone, so... Not sorry...
  8. Tommi Prami

    OtlParallel Memory Leak

    Heh.. You seem to have no crasp of Multi threaded development, and fail to listen ones that REALLY know what tey are talking about,. (No need to listen me, but above there are messagews from people, that really know their shit, but...) -Tee-
  9. Tommi Prami

    OtlParallel Memory Leak

    I bet you did not fix the actual problem here. -Tee-
  10. Tommi Prami

    OtlParallel Memory Leak

    If you write and/or access same string from multiple threads, is not thread safe. If you did not get errors or memory leaks is pure luck, or you did not check memory leaks with tool, that actually will report you the actual horror of updating strigg from multiple thread without proper protection (not a condom) -Tee-
  11. Tommi Prami

    function declarations without ; at the end

    Maybe you could make bug report to emba, maybe they fixit or not. -Tee-
  12. Hello, Tried to find the documentation of [ref] attribute, famously used in FreeAndNil -implementation lately, but could not find it from Embacdero help. (FreeAndNil is defined as: procedure FreeAndNil(const [ref] Obj: TObject);) So could someone point me to the documentation of the attribute ands/or explain what it actually does? -Tee-
  13. Works. Thank you very much! -Tee-
  14. Tommi Prami

    What does [ref] attribute actually dows

    Tried that with record as parameter, did not see any speedup, const and const [ref] had same performance. Winning clearly if it was passed as by value eith const ore var. I was jsut thinkin that could there be places and code (in my code ba se for example) thjat could benefit from [ref]? -Tee-
  15. Tommi Prami

    What does [ref] attribute actually dows

    I have been in impression that const actually would do something like that already. So parameter would be passed as reference. Will juust not allow changin it.... Is there some clear benefit of using [ref],m unless in need of doing something like in the FreeAndNil iomplementation.
  16. I see the same behavior, with single 4K monitor.
  17. Yellow, Has anyone done parallel tests, of some kind. Some tests I have to run takles quite a long time, and might be nice to run those in parallel., In this case tests are just procedure with all code, that does something for different inputs (from predefined array etc). So in theory it would be simple, with TTask from PPL. I was just thinking what I have to take into consideration if test fails etc. I would need to use PPL, for these, sadly OTL is not possibility. As far as I know, there is nothing built in in the DUnitX. -Tee-
  18. Tommi Prami

    Running tests in Parallel (or sub test in side one test)

    Yellow, again... Did Quick tests with PPL, seems that tested code it self did not work wery well when runniing in parallel. Do'h Heve to to think of this later... Code should be about thread safe, but did not cope, or at least I did not saw anything that was obviously not thhread safee and protected few spots with Critical section. -Tee-
  19. Tommi Prami

    TCachedDatasource

    Yellow, I was pondering have you measured in some way will this actually speed things up. -Tee-
  20. I was curious does the compiled optimize out inhetiance that is needlesly added. Turns out it can't. Is there any technical reason that this is not possible, how Delphi classes work, or it is just missing optimization from Delphi compiler., My point here is that, if you care, remove unneeded in heritance from ytou code base. Effect is very small, most likely not even measurable, but do as you please. In very tight loopå this might be porblem, most cases not. Why someone would add those, is different discussion. Sometimes I add overridden method, because I think I need to do something in there, but I just forget to remove it later. Test project: unit Unit27; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TForm27 = class(TForm) Button1: TButton; Memo1: TMemo; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; TBaseClass = class(TObject) strict private FList: TStringList; public constructor Create; destructor Destroy; override; end; TFoo1 = class(TBaseClass) strict private public constructor Create; destructor Destroy; override; end; TFoo2 = class(TFoo1) strict private public constructor Create; destructor Destroy; override; end; TFoo3 = class(TFoo2) strict private public constructor Create; destructor Destroy; override; end; TFoo4 = class(TFoo3) strict private public constructor Create; destructor Destroy; override; end; TFoo5 = class(TFoo4) strict private public constructor Create; destructor Destroy; override; end; TFoo6 = class(TFoo5) strict private public constructor Create; destructor Destroy; override; end; TFoo7 = class(TFoo6) strict private public constructor Create; destructor Destroy; override; end; TFoo8 = class(TFoo7) strict private public constructor Create; destructor Destroy; override; end; TFoo9 = class(TFoo8) strict private public constructor Create; destructor Destroy; override; end; TFoo10 = class(TFoo9) strict private public constructor Create; destructor Destroy; override; end; var Form27: TForm27; implementation {$R *.dfm} uses System.Diagnostics; procedure TForm27.Button1Click(Sender: TObject); const LOOP_COUNT = 1_000_000; var LSW: TStopwatch; begin LSW := TStopwatch.StartNew; for var I := 1 to LOOP_COUNT do begin var LObject := TBaseClass.Create; LObject.Free; end; LSW.Stop; Memo1.Lines.Add('BaseClass: ' + FormatFloat('0.00', LSW.Elapsed.TotalMilliseconds) + ' ms'); LSW := TStopwatch.StartNew; for var I := 1 to LOOP_COUNT do begin var LObject := TFoo10.Create; LObject.Free; end; LSW.Stop; Memo1.Lines.Add('unneeded inheritance: ' + FormatFloat('0.00', LSW.Elapsed.TotalMilliseconds) + ' ms'); end; procedure TForm27.FormCreate(Sender: TObject); begin end; { TBaseClass } constructor TBaseClass.Create; begin inherited Create; FList := TStringList.Create; end; destructor TBaseClass.Destroy; begin FList.Free; inherited Destroy; end; { TFoo9 } constructor TFoo9.Create; begin inherited Create; end; destructor TFoo9.Destroy; begin inherited Destroy; end; { TFoo1 } constructor TFoo1.Create; begin inherited Create; end; destructor TFoo1.Destroy; begin inherited Destroy; end; { TFoo2 } constructor TFoo2.Create; begin inherited Create; end; destructor TFoo2.Destroy; begin inherited Destroy; end; { TFoo3 } constructor TFoo3.Create; begin inherited Create; end; destructor TFoo3.Destroy; begin inherited Destroy; end; { TFoo4 } constructor TFoo4.Create; begin inherited Create; end; destructor TFoo4.Destroy; begin inherited Destroy; end; { TFoo5 } constructor TFoo5.Create; begin inherited Create; end; destructor TFoo5.Destroy; begin inherited Destroy; end; { TFoo6 } constructor TFoo6.Create; begin inherited Create; end; destructor TFoo6.Destroy; begin inherited Destroy; end; { TFoo7 } constructor TFoo7.Create; begin inherited Create; end; destructor TFoo7.Destroy; begin inherited Destroy; end; { TFoo8 } constructor TFoo8.Create; begin inherited Create; end; destructor TFoo8.Destroy; begin inherited Destroy; end; { TFoo10 } constructor TFoo10.Create; begin inherited Create; end; destructor TFoo10.Destroy; begin inherited Destroy; end; end.
  21. Any optimization that makes Object/Recor "init/deinit" faster is surely good optimization. These will make almost mall apps faster. Other good candidates would be TList, TStrings, TDataSet (and descendants), just on top of my head. All in those would help in many places. Surely there are tons of places in RTL thatb would need some love...
  22. That is quite nice. Thanks for info.
  23. For sure. I just thought (or hoped) that this kind of unneeded stuff would be optimized out quite from the start. Curiocity came from, that I stumbled upon that kind of code, not that deep for sure as my example, just wanted to measure, and report the results here. -Tee-
  24. True, Benefit would be very small.
  25. Tommi Prami

    Omnithread for UBUNTU

    I think you need to fork, and make OTL work on ubuntu and make pull request, and hope it will be accepted. If Primoz don't use Linux him self, I think he has little interest to make it work on Linux, just for fun of it. -Tee-
×