Jump to content

Anders Melander

Members
  • Content Count

    2297
  • Joined

  • Last visited

  • Days Won

    119

Posts posted by Anders Melander


  1. 43 minutes ago, Renate Schaaf said:

    Newest addition: a parallel unsharp-mask using Gaussian blur. Can be used to sharpen or blur images.

    Have you benchmarked this against some of the existing Gaussian blur implementations?

     

    It's a bit difficult to decode the algorithm you use due to the lack of comments in the source but it appears you are just applying a Gaussian kernel (with some additional logic) and that approach is usually quite slow.

     

    I have a benchmark suite that compares the performance and fidelity of 8 different implementations. I'll try to find time to integrate your implementation into it.

     

    With regard to the ratio between Radius and Sigma, it's my understanding that:

    Ratio = 1 / FWHM (Full Width at Half Maximum)
          = 1 / (2 * Sqrt(2 * Ln(2)))
          = 0.424660891294479
    

    But you have a ratio of 0.5

    Have I misunderstood something?


  2. 39 minutes ago, FreeDelphiPascal said:

    My question was maybe not very clear.

    Oh, you think? :classic_dry:

     

    39 minutes ago, FreeDelphiPascal said:

    I am talking about decoding multiple JPG files in parallel.
    Maybe in a pool of threads equal to the number of cores... 

    Yes, of course you can do that.

    You don't need a special library to decode a jpeg in a thread.


  3. 3 minutes ago, DelphiUdIT said:

    Like I told every builds produce different executables.

    Yes, but not that different.

    There's a difference of 14,307,328 bytes between his two files and one of them has an extra PE section...

     

    Anyway, if he can't be bothered to compare the files in a proper tool and tell us what that extra section contains, then I think I'll spend my time on something else; The lawn needs mowing.


  4. 18 minutes ago, limelect said:

    Thanks

    
    throw std::exception(“PE Tools source code is not available”);

    maybe there is

     

    No files No source

    Too simple what I did is much better

    I have no idea about what you are trying to say here. I don't speak Haiku...

    • Like 1

  5. 5 minutes ago, limelect said:

    I do not really know why the compiler makes 2 different

    execute on the same source but definitely, there is a difference

    Do you use madExcept, Eurekalog, or something like that?

     

    It could be that something modifies the exe post-link.

     

    It could also just be something not so nice adding its own payload to your application...


  6. 3 minutes ago, Renate Schaaf said:

    This link is about compression, but couldn't it apply to decompression too? (not that I know anything about it 🙂

    https://stackoverflow.com/questions/61850421/how-to-perform-jpeg-encoding-of-a-big-rgb-image-in-parallel

    Yes, there will of course always be some parts that can be parallelized but the problem is that the expensive part, the Huffman decoding, cannot.

     

    6 minutes ago, Renate Schaaf said:

    Anyway, there are research papers which claim that they got a speedup from doing the decoding partly in parallel.

    I'm guessing they used "cooked" jpegs because there's really not much magic that can be done here.

     

    I think the effort is better spent on using SSE, AVX, or the GPU to decode - which is also what I believe most high-performance decoders do.


  7. 1 hour ago, Renate Schaaf said:

    I have no idea how parallelizable jpeg-decoding is

    Most modern jpegs require sequential decompression due to the compression algorithms used (decompression of a block is based on the result of the previous block); There's nothing much to parallelize.

     

    Jpegs with lots of restart markers (a restart marker means that the result of the previous blocks isn't needed) in the compression stream would benefit from parallelization but it is my understanding that those have become very rare as the problem they were meant to solve (data corruption during download via modem) no longer exist.


  8. 1 hour ago, FabDev said:

    My computer has 32 GB of memory, but the Delphi IDE crash after 2.5 GB... :classic_angry:

    The address space of a 32-bit application is 4GB. Some of that is reserved by Windows. By default 2GB but for Large Address Aware applications (such as the Delphi IDE) it's 1 GB. These values can be customized globally. Your hardware configuration (motherboard, etc..) can have an effect on the reserved size, btw.

    https://learn.microsoft.com/en-us/windows/win32/memory/virtual-address-space

     

    If you are running out of memory at 2.5GB then the IDE is trying to make an allocation of 0.5 GB or more. This seems unlikely so there could be something else going on. You might wait to check the size of "hardware reserved memory" on your system.

     

    1 hour ago, FabDev said:

    And what happens when more than 100 forms are opened at the same time or after intensive code completion using or pressing F1 (for help) > out of memory.

    100 forms open at the same time is hardly a typical use case. Why would you ever want that?

     

    FWIW, I just tried opening all the over 600 forms, frames and datamodules of a project with around 3 million lines of code. It uses DevExpress ribbon, docking, skins, grids, and controls, FireDAC, etc. That consumed 3.4 GB but happily compiled and linked. It's a 64-bit project.

     

    I'm not saying that your problem isn't real but I don't think this problem is common enough that it alone justifies migrating the IDE to 64-bit. And I certainly don't think your rhetoric will help your case.

    • Like 2

  9. 5 hours ago, Heremik said:

    TBitBtn = 0 GDI

    Looking at the source of TBitBtn, it can either use an internal TBitmap (which will consume at least 1 handle per button) or it can use an external imagelist (which will consume at least 1 handle globally [*]).

    [*] Drawing an imagelist in the disabled state consumes another handle, drawing it monochrome another.

     

    I would stay away from TBitBtn. It was cute in the nineties but today few people want their application to look like it was made in the nineties...


  10. 2 hours ago, Heremik said:

    I have made a ticket for TMS support, because even their sample use 500 GDI for a minimal Ribbon.

    For comparison, I have a simple application that's using DevExpress ribbon, DevExpress grids and a virtual treeview and it uses 400-450 GDI handles.

     

    2 hours ago, Heremik said:

    But I have begun to reduce GDI usage in the remaining of the software by moving imagelist present in frames instancied several times, to a datamodule.

    An imagelist itself uses at most one GDI handle - if any. It's the individual bitmaps that copy data from the image list that uses the handles.


  11. 16 hours ago, luciano_f said:

    I have a version 10.2 license and I have problems with low memory when compiling a large application. I tested version 11.3 and the problem is the same.

    When will Embarcadero be ashamed and make a robust 64-Bit IDE? I'm already thinking seriously about Lazarus

    I already made this post

    Friends could also do the same thing, who knows, everyone asking for the same thing and giving could speed this up.

     

    https://quality.embarcadero.com/browse/RSP-42372

    That issue basically just says "Give me a 64-bit version because I say so - or else". I would just close it if I were Embarcadero.

     

    But I'm sure that migrating to Lazarus will ensure that you don't have to worry about memory limitations anymore. You will have a whole slew of other problems to keep you busy instead. Good luck with that.

    • Like 2
    • Haha 2

  12. 3 hours ago, Alexander Halser said:

    The rationale behind this consideration is that a mobile app goes to one of the stores and automated updates are very likely, minimizing the risk of a version mismatch between app and help. Furthermore I expect a mobile device to be online anyway. Both points may not apply to a desktop app. But it's really a personal preference.

    It makes perfect sense to me.

    • Like 1

  13. 33 minutes ago, Uwe Raabe said:

    There is no need to have line breaks when they are later ignored anyway.

    So you don't format your source code with line breaks? - Because the Delphi compiler will ignore them anyway.

     

    It's not something I often do, but once in a blue moon I need to have a largish block of text in the source and that's just the way it is. Let's assume that there are reasons for this and that I know what I'm doing.

    • Like 2

  14. 1 hour ago, Heremik said:

    TMS Ribbon use more than 5000 GDI objects for an interface of only a dozen of tabs (and related ribons) !!!!!!

    Sounds like a bug to me.

    Have you checked the application for resource leaks?

    • Like 1

  15. 33 minutes ago, Stefan Glienke said:

    The closing quotes dictate the alignment, lines inside the string thus cannot be more left than the closing quotes, the last line does not have a trailing line break, if you want a trailing line break, add an empty line

    By Ignore newline I meant from this:

      Lorem

      ipsum

      dolor

    produce this:

      lorem ipsum dolor

×