Midas Speed Fix – Unit

By | January 21, 2009

The MidasSpeedFix.pas is a unit that improves the performance of the Midas.dll and MidasLib unit. This is done by replacing the Midas memory manager with the Delphi memory manager (FastMM4). The unit compiles and works with Delphi 6 to 2009. (My Delphi 5 Pro doesn’t have a DSIntf unit)

Delphi 6 to 2005: FastMM4 must be compiled in RELEASE mode to get maximal speed.

How to use:
Add the MidasSpeedFix.pas unit to your Delphi or C++ Project (ProjectManager: Add Unit)


Name IDE Version File Size Downloads Added
Midas Speed Fix 1.2 6-2009 MidasSpeedFix12.zip 35.96 KB 6218 times 2009-03-11

22 thoughts on “Midas Speed Fix – Unit

  1. Alexandre Machado

    Man, you are really a genius. God bless you! 😉

    Best regards

  2. Alexandre Barbosa Simplício

    Já foi respondida minha duvida, favor desconsiderar a pergunta anterior…


  3. Alexandre Machado

    Hi Andreas.

    I’ve tested you MidasSpeedFix with success in BDS 2006. I’ve tested a ClientDataSet inserting 57,000 records and it is flying now!
    But the funny thing is: When the same 57,000 records come from another DataSet (through a linked TDataSetProvider), the time the CDS is 10 times slower (4.5 seconds, inserting x 44 seconds, loading from TDataSet+TDataSetProvider). The original DataSet (an ADOQuery) takes only 0.75 seconds to fetch all recordset. Isn’t it weird?

    Best regards

  4. Alexandre Machado

    About my previous post: Forget about it! The problem is not inside Midas. Simply, the provider doesn’t call DataSet.DisableControls, and so most of the time is spent scrolling the DataSet. 😉

    Best Regards

  5. ibandyop

    You are amazing !!! Got better results with more records. Over 50% increase when inserting!

  6. George Gravos

    Hi Andreas,
    First a huge thanks for all your efforts. I have used this fix in an .exe project that used the midaslib unit and all went well. But, I have another project in which the fix is not working. That project is built with packages and is also using midaslib that is compiled (the midaslib unit i mean) inside its own package. So, I have package prtnrMidas70.bpl that contains the midaslib unit. My .exe is using the above mentioned package (along with all the other needed packages). It is also using the FastMM4 unit and your MidasSpeedFix.pas. It is failing to find the Org_MidasMalloc! Any ideas? I’m using Delphi 7 on this project.

    Please contact me directly in case you need any additional info.

    Thanks in advance,

  7. Andreas Hausladen Post author

    In that case you must add the MidasSpeedFix unit to the prtnrMidas70.bpl package. MidasSpeedFix uses the HInstance variable to find the memory addresses. And if MidasSpeedFix is in a different module than the MidasLib unit, HInstance will point to the wrong module.

  8. Sean Leyne

    In the CodeGear article:


    There is mention of the MidasLib unit, in the “Deploying Applications Without the Midas Library” section.

    Will the MidasSpeedFix still provide benefit, if you are using the MidasLib?

  9. Guus


    Looks great. Can this unit also be used in a Delphi.NET project? I’m currently using a TClientDataSet in a Delphi.NET (2007) project…


  10. Andreas Hausladen Post author

    @Guus: If you put the unit into a native DLL and then load the DLL into your Delphi.NET application where you use the Midas.dll, then yes.

  11. marc antheunis

    Hi Andreas,
    i’m speechless…
    if it was a MS product they had you on their MVP list already…

  12. Pavel Katalymov

    It gives no real effect if one uses Full fastMM4 in “FullDebug” mode under D 2007,
    but my the same test works more then twice faster “Release” mode.
    Thanks a Lot!

  13. Joao

    It can be used with projects that use httpsrvr.dll ?

Comments are closed.