The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,762 other followers

Archive for the ‘FastMM’ Category

Useful settings for FastMM4 to tracking bottlenecks in multi-threaded memory allocation

Posted by jpluimers on 2019/05/23

Interesting thread that reminded me of the relatively new FastMM feature to track down lock contention and cope with it using release stacks:

[WayBack] I try use FastMM4 to tracking bottleneck in allocating memory. I was inspired by this Primož movie: https://www.youtube.com/watch?v=p-5mJyXvmrc When I… – Jacek Laskowski – Google+

The changes by Primož have added these two new conditional defines to the FastMM4 codebase:

These options are mutually exclusive.

This was the original post it got introduced in [WayBack] The Delphi Geek: Finding Memory Allocation Bottlenecks with FastMM4 and merged into the main repository.

FastMM introduction: [WayBack] The New Memory Manager In BDS 2006 – by Pierre le Riche.

It also taught me about [WayBack] RAMDisk – Software that Accelerates, Protects, Optimizes – Server Memory Products & Services – Dataram.

Primož stores his DCU files there: much faster than SSD, and far less wear on your SSD; see https://youtu.be/p-5mJyXvmrc?t=2675

–jeroen

Read the rest of this entry »

Posted in Conference Topics, Conferences, Delphi, Development, Event, FastMM, Software Development | Leave a Comment »

Have NoMessageBoxes depend on a global boolean · Issue #58 · pleriche/FastMM4 · GitHub

Posted by jpluimers on 2018/08/16

Reminder to self: [WayBackHave NoMessageBoxes depend on a global boolean · Issue #58 · pleriche/FastMM4 · GitHub

–jeroen

Posted in Delphi, Development, FastMM, Software Development | Leave a Comment »

A success story – kudos to ScaleMM, +André Mussche… – Ondrej Kelle – Google+

Posted by jpluimers on 2018/08/15

Though no maintenance for over 2 years, it ScaleMM seems among the fastest of Delphi memory managers: [WayBack] GitHub – andremussche/scalemm: Fast scaling memory manager for Delphi

Full story via [WayBackA success story – kudos to ScaleMM, +André Mussche… – Ondrej Kelle – Google+ at [WayBack] just tried Scaled MM – cut the time for 100k down from 51 minutes to 40 minutes. That’s with 18 (9+9) cores allocated to the app and 2 to everything else. Wow, allocating 8 + 8 and the time drops even more… – Russell Weetch

Two lessons on multi-threading here:

  • use a memory manager that copes well with threads
  • do not allocate more busy threads than available (hyper-threaded) cores

Some history (as ScaleMM, TopMM and FastMM seem to be related):

  • A bit of history here: at the time we had the mm contest. Not many people had access to 8 cores+, we had…. Andre and Ivo were both colleagues of mine at that point, although working for different companies. We needed (stock trading, Ivo and me) something to scale and Ivo wrote topmm, which still performs better on multi-cores than fastmm and has less assembler code. Andre improved on Ivo’s concepts and yes, it really outperforms fastmm on multi-cores today.
    It also out-performs most C family provided mm’s. Note I was not massively involved, but both Ivo and Andre were. And both did a proper job. So KUDOS to them.
    Note these (fastmm and topmm) were written with multi-core in mind. The practical results at the time were often under-estimated, because few people had access to the real hardware. Most of us running two cores at most. Nice to see that the concept those two programmers pursued still pays dividend in 2018!
  • Read: ScaleMM and TopMM and FastMM… Keyboard left me..
    (I wrote COMMM as a joke..!).
  • [WayBack] TopMemory v3.55. High Performance. Fully Scalable. Free. Memory Manager. for. Delphi – PDF
  • [WayBack] FPC Anagrams

There are also some IntelTBB memory manager references at https://plus.google.com/+RussellWeetch/posts/W4EQgLme5ud [WayBack]

–jeroen

Posted in Delphi, Development, FastMM, Software Development | Leave a Comment »

“Unknown function at TMethodImplementationIntercept”

Posted by jpluimers on 2018/06/01

Reminder to self: when you get Unknown function at TMethodImplementationIntercept in a Delphi stack trace from the Exception.StackTrace property or FastMM memory report:

  1. Ensure you generate a .MAP or .TDS file with full debug information
  2. Copy the .MAP or .TDS files to directory of your EXE.

Via:

The Exception.StackTrace was introduced in Delphi 2009 that extended these [WayBackException Members:

Some notes:

  • Fields where you can put hooks in; if there is no hook in place, they won’t be used:
    • [WayBackException.GetExceptionStackInfoProc Field GetExceptionStackInfoProc: function (P: PExceptionRecord): Pointer;
      • This function is called to return an opaque data structure that contains stack information for the given exception information record. This function will be called when the exception is about to be raised or if this is an external exception such as an Access Violation, called soon after the object is created.
    • [WayBackException.CleanUpStackInfoProc Field CleanUpStackInfoProc: procedure (Info: Pointer);
      • This function is called when the destructor is called to clean up any data associated with the given opaque data structure.
    • [WayBackException.GetStackInfoStringProc Field GetStackInfoStringProc: function (Info: Pointer): string;
      • This function is called to return a string representation of the opaque data structure returned by GetExceptionStackInfoProc

TMethodImplementationIntercept was introduced in the System.Rtti unit of Delphi XE6 [WayBack]:

–jeroen

Example code:

Posted in Delphi, Development, FastMM, Software Development | Leave a Comment »

Delphi: There is a FastMM4 fork with AVX support and multi-threaded enhancements (faster locking) – how will it impact floating point heavy applications (as Delphi uses SSE instructions for floating point)

Posted by jpluimers on 2018/05/01

Interesting fork of FastMM4 for which I now think I understand why it is not merged into the regular FastMM4 repository: [WayBack] GitHub – maximmasiutin/FastMM4-AVX: FastMM4 fork with AVX support and multi-threaded enhancements (faster locking).

The fork does two things:

  • it has multi-threading enhancements (faster locking)
  • AVX support which seems tough for floating point heavy applications as Delphi generates SSE instructions for them

Reminder to self: how big is that impact and could the locking be separately merged into the base repository?

Eric Grange:
Looking at https://github.com/pleriche/FastMM4/issues/36 and given than the compile generates SSE2 code for floating point, I guess using AVX may be problematic when your code also does a lot of floating point using Delphi code (rather than AVX asm)

It could be that this repository is using only AVX-128, which might not have a penalty as per Advanced Vector Extensions – Wikipedia:

The AVX instructions support both 128-bit and 256-bit SIMD. The 128-bit versions can be useful to improve old code without needing to widen the vectorization, and avoid the penalty of going from SSE to AVX, they are also faster on some early AMD implementations of AVX. This mode is sometimes known as AVX-128.

Via: [WayBack] Do you use Embarcadero version of FastMM or the “official” bleeding edge version of FastMM from the gitHub repository? Any idea what are the difference… – Tommi Prami – Google+

–jeroen

Posted in Delphi, Development, FastMM, Software Development | 5 Comments »

 
%d bloggers like this: