Jump to content

hsauro

Members
  • Content Count

    88
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by hsauro


  1. If anyone is interested in comparing skia (using skia4delphi) versus VCL for drawing points/pixels, here is a quick demo that draws the Mandelbrot set. The VCL drawing code doesn't use scanlines which I know would be faster but just uses Pixel[i,j] which we know is notoriously slow. The skia code uses DrawPoint although I'm not sure if that is the equivalent to Pixels or not

     

    The code also illustrates how you can draw to a skia canvas then copy the result to a TImage. The code could certainly be updated to improve its organization but I didn't have the time. 

     

    Code at: 

     

    https://github.com/hsauro/Mandelbrot

     

    There is a binary release on Github,

     

    https://github.com/hsauro/Mandelbrot/releases/tag/1.0

     

    I couldn't include the binaries here because the skia dll exceeds the size limit for attachments. 

     

    Spoiler Alert: skia was faster.


  2. 11 hours ago, dummzeuch said:

    Not going to happen. And neither the IDE.

     

    We have had this discussion too many times already.

    I know it’s discussed before but there is not harm in suggesting it again. Some Embarcadero employees read these forums.


  3. 3 hours ago, BruceTTTT said:

    Ditto. At least they could tell us when and if it's expected so I could stop checking.

    Apparently it’s delayed due to high res dpi issues. It’s good that Embarcadero is having to develop it and discover the problems others have encountered with high res dpi. We might get some fixes as a result.

    • Like 4
    • Haha 1

  4. 3 hours ago, Stefan Glienke said:

    You're welcome - it is just a slightly improved version of what Aleksandr Sharahov already wrote years ago. Surprisingly they never used his purepascal code which compiles to almost the exact same code as the x86 asm version was doing.

    There are more than a dozen other improvements in the RTL that I have worked on - I cannot fix their compiler but I can certainly improve some suboptimal RTL code.

    Thanks for doing this, this is one place the community can help. Your efforts might inspire others to contribute.

    • Like 3

  5. On 11/5/2020 at 3:55 AM, Fr0sT.Brutal said:

    I've no idea about numpy and how it organizes its arrays but making array object point to a buffer coming from Delphi is exactly what I meant

    Did you ever resolve your question? I am also interested in accessing numpy to and from Delphi.


  6. On 3/11/2019 at 8:11 AM, Der schöne Günther said:

    That looks very exciting, but I do find the prices a bit steep 😶

     

    Does one license work with both RAD Studio and Visual Studio integration?

     

    For VS, does it find leaks for C++/CLI Mixed mode applications?

    Doesn’t look that expensive, $99 for personal copy and $399 for developer.


  7. 8 hours ago, David Heffernan said:

    The most significant issue is that Set8087CW and SetMXCSR are not threadsafe.

     

    It's a bit of effort to fix it because you need to patch things like the code that handles external exceptions, which also interacts with fp unit control state.

     

    I wrote a comprehensive explanation of the issues, and how I addressed them. On request from Emba staff. I submitted that doc as a QC report. Emba then killed QC and asked me to resubmit all my disappeared QC reports. That pissed me off. 

     

    Doc is here 

     

    https://drive.google.com/file/d/0B2MV9dPR57BUbnVvNW0zaEFnYTg/view?usp=drivesdk


    Thanks for the link.  I read through the document, it doesn’t seem such an unreasonable thing to implement for the company. They should allow developers such as yourself to contribute to the libraries, perhaps in return for free licenses. The company either lacks interest, expertise or doesn’t have the bandwidth.


  8. 2 hours ago, David Heffernan said:

    In my case I have to apply bespoke patch to rtl code to fix all the floating point defects that Emba won't fix. And that requires a chunk of work for every distinct version of Delphi.

    I know it’s off thread, but this sentence piqued my interest, what kinds of defects are you referring to? I used to do more numerical work on Delphi than I do these days but it would still be interesting learn more about these.mmaybe you’ve written them up or mention them somewhere?

     

    I just saw your last reply to someone else who had the same question, I think you answered the question there.


  9. On 6/13/2019 at 12:47 PM, Mike Margerum said:

    I went same route with swift on mac/ipad.  Aside from apple breaking swift every version it came out really good and i was able to reuse a significant amount of code between the platforms.  Swift is a nice language but having to interface with all of that objC API code was painful.  Apple is definitely going the right direction with Swift and making new Swift only APIS.

     

     

    It would have been nice if i was able to use the same code on windows and ios/mac, but I realize that's mostly a pipe dream now.  

     

    Agree on Lazarus.

     

    I switched off python and started using Go.  Just had better experience keeping production stuff running better with Go.  Its the perfect server code language IMO.

     

    So going forward i'm using swift for iOS / Mac and Go/Vue/Vuetify/Electron for multiple platform stuff.  Svelte.js looks very impressive and i may switch off Vue in a few years.

     

    I'm not even comfortable keeping Delphi for win32 development at this point.  Microsoft has such a schizophrenic desktop development story.   I have no idea what to use to build native windows clients so I just won't i guess.  I may downgrade and keep delphi pro.  When you use reactive frameworks like Vue and soon SwiftUI, the old delphi style way of building GUIS feels bad.

     

    WebAssembly is something I'm keeping my eye on as well.  I suspect this may become a great way to build multiplatform stuff both in and out of the browser.  Remobjects doing some interesting stuff in this space.

     

    It would be fun if there were an object pascal to webassembly compiler.

     


  10. Slightly off topic I know but what what is the rational for having immutable strings in languages such a Java, Python etc?

     

    It seems immutability is related to efficiency and security. I didn’t find the arguments that compelling however. It seems it’s either to stop the programmer from getting into trouble or it makes like easier for the complier writer.


  11. 11 hours ago, Uwe Raabe said:

    In modern Delphi versions I try to combine record constructors and array concatenation to achieve that:

    
    program Project481;
    
    {$APPTYPE CONSOLE}
    
    type
      TSomeRec = record
        SomeField: Integer;
      public
        constructor Create(ASomeField: Integer);
      end;
    
      TMyArr = TArray<TSomeRec>;
    
    constructor TSomeRec.Create(ASomeField: Integer);
    begin
      SomeField := ASomeField;
    end;
    
    procedure Main;
    var
      myArr: TMyArr;
      myRec: TSomeRec;
    begin
      myArr := [TSomeRec.Create(0), TSomeRec.Create(1)];
      myArr := myArr + [TSomeRec.Create(2)];
      Insert([TSomeRec.Create(3)], myArr, 1);
      for myRec in myArr do begin
        Writeln(myRec.SomeField);
      end;
      Readln;
    end;
    
    begin
      Main;
    end.

     

     

    Using record constructors like this is very convenient but I wonder what the speed penalties are like?


  12. Out of interest, I thought I'd show a scatter plot of the mean and standard deviation from 100 independent runs. Each data point was obtained by measuring how long it took to run a particular method and repeating this 10,000 times and taking the mean and sd for that data. Each set of 10,000 measurements was an independent run started from a batch file. The application itself was run 100 times from the batch file which yields the 100 data points in the plots below. It is interesting to note some outliers around the 35 and 90 iteration. I never touched the computer during this run so this could be some internal housekeeping going on. The standard deviation has quite a bit of variability but ignoring the outliners the mean is fairly consistent at 3.5. Having seen this data I have more confidence in the mean.  Y axis is time and x axis is the run number. The code is doing a lot of memory allocation and deallocation of small blocks of memory (16 bytes at a time) and a lot of simple calculations (but no I/O).

     

    image.png.0778b279c2ec3df6e7826f19503924c0.png

     

    Out of interest, the following graphs were obtained where all 100 runs were done in the same application. (no batch file) What I thought was interesting is the decline in the standard deviation as the program progressed. Not sure what the blip at 20 or 70 is. 

     

    image.png.d68366a5a5ac64582d78b5b4c3b5c6f4.png

     

    Herbert


  13. 1 hour ago, stijnsanders said:

    And then there's also memory refresh and other system interrupts that will happen inbetween your program. If you have a multi-processor machine, what you could also do is set processor affinity to force the thread(s) to run on a single core, to minimize interruptions like this.

    Exactly that's why I was asking if there was a way to measure the actual amount of time spent in my process and not dealing with everything else which is unpredictable. 


  14. 1 hour ago, David Heffernan said:

    Doesn't seem like a massive amount of variability. Probably depends on what your code does.

     

    You are measuring what is known as wall clock time. Total elapsed time. Why would you want to measure anything else? Wall clock time is the time as perceived by the users. 

    My concern was if the time measured is all CPU activity them comparing different implementations of my code run at different times might give unreliable estimates because there could be a different amount of background activity in the two runs. I presume this is the origin of most of the variability I am seeing. I have noticed there is an initial startup component to the variability (cache vs hard drive I assume) and that repeated runs after the first few runs stabilize the times to be less variable. I've noticed that timings I see reported byothers often have no variability estimate on them.

     

    Herbert


  15. I am measuring the performance of some Delphi code using TStopwatch and I'm seeing considerable variation in the computed times. I run a method 10,000 times and record the time. I then do this 200 times (all within the same program) from which I get an average time of 3.79 seconds for the 10,000 runs with a standard deviation of 0.55.

     

    That seems to be quite a large variability. My question is, does TStopwatch measure the total time elapsed or just the time spent on my particular process? If it measures the elapsed time is it possible to measure the amount of time specifically used to execute my code?

     

    Herbert

×