Steve Maughanhttps://www.stevemaughan.com
The Life & Times of the Maughan Family
Mon, 21 May 2018 09:06:59 +0000 en-US
hourly
1 https://wordpress.org/?v=5.1.134604095Delphi Parallel Programming Library & Memory Managershttps://www.stevemaughan.com/delphi/delphi-parallel-programming-library-memory-managers/
https://www.stevemaughan.com/delphi/delphi-parallel-programming-library-memory-managers/#commentsTue, 09 Feb 2016 21:56:01 +0000http://www.stevemaughan.com/?p=570In September 2014 Delphi XE7 was launched. I was excited to try the new Parallel Programming Library (PPL). I thought I’d be able to quickly and easily write code which takes advantage of the processors in my Intel i7 machine. To my dismay the performance improvement were virtually non-existent if there was any memory allocation carried out in parallel. I even brought up the subject on Google+ (see here: https://goo.gl/hWc6Z6). The bottleneck seemed to be with FastMM4. When it was first bundled with Delphi 2006, FastMM4 was a breakthrough in single core memory management. But FastMM4 had not been designed for multi-threaded performance. In my tests the PPL versions of my test routines were slower than the single core versions. I concluded it was wiser to stick with the simpler single core routine, and hope for a solution.

A week ago I stumbled across this thread on Google+, “Why is the FastMM4 development stalled?”. I’d never heard about NexusDB’s memory manager. Apparently it scales well in a multi-thread environment. Eivind Bakkestuen from NexusDB kindly offered to provide a test copy. So I thought I’d give it a try. I went back to my main application and fired up the parallel map rendering routines of my Sales Territory Mapping application. To my amazement I got a instant speedup of 68% when using the NexusDB memory manager. I was ecstatic! Out of pure interest I then tried the parallel rendering using FastMM4. To my surprise FastMM4 performed equally as well as NexusDB. What has changed since 2014? FastMM4 hadn’t been updated since May 2013. Was it something new with the PPL included with Delphi 10 Seattle? Or was it as a result of Windows 10. I also noticed the memory manager included with Delphi didn’t perform quite as well as explicitly including FastMM4 at the start of the “dproj” file.

So I set out to create a test and investigate further.

I created a test project (you can download it here). It’s nothing special. The small app creates and destroys lists of small and simple objects. I quickly established there was no speed difference between XE7 and Delphi 10 Seattle applications. I then create six Delphi 10 Seattle versions of the application; a 32 bit and 64 bit version of with the native memory manager, FastMM4 and NexusDB:

Speedtest-Native-32.exe

Speedtest-FastMM4-32.exe

Speedtest-NexusDB-32.exe

Speedtest-Native-64.exe

Speedtest-FastMM4-64.exe

Speedtest-NexusDB-64.exe

Each executable can run in single-core or multi-core mode. You can download the executables here (SpeedTest.zip). I then ran them on four different laptops:

Dell XPS 15: Windows 10 2.6 GHz i7-6700HQ

HP from 2009: Windows 7 2.2 GHz i7-2670QM

HP from 2014: Windows 8.1 2.4 GHz i7-3630QM

Surface Book: Windows 10 2.4 GUs i5-6300U

Here are the 32 bit results – each value is the times in milliseconds required to execute (smaller is better):

And here are the 64 bit results – each value is the times in milliseconds required to execute (smaller is better):

And here are the key points:

NexusDB’s memory manager was impressive in every multi-threaded test (in some cases double the speed of FastMM4)

FastMM4 did much better than I expected. There was a measurable speed improvement in all multi-threaded tests

The native memory manager (which I thought was FastMM4) was measurably slower than FastMM4 in most multi-threaded tests (e.g. 64 bit multi-threaded). The difference was negligible in single thread tests.

I was amazed at how well the 2009 laptop performed – Moore’s Law is clearly dead for laptops.

My conclusion is that NexusDB’s memory manager is the one to use if multi-thread performance is an issue.

All of these tests were carried out on laptops. I’d love to see the speeds when run on an eight core machine.

]]>https://www.stevemaughan.com/delphi/delphi-parallel-programming-library-memory-managers/feed/9570Accelerating Towards the End of the Eurohttps://www.stevemaughan.com/politics/accelerating-towards-the-end-of-the-euro/
https://www.stevemaughan.com/politics/accelerating-towards-the-end-of-the-euro/#respondTue, 26 Mar 2013 14:13:19 +0000http://www.stevemaughan.com/?p=478Cyprus has swallowed the bitter pill and skimming off the cash they need for the accounts of depositors with more than €100k. Some say this is theft. This was my first reaction. And if the funds were being used to simply bail the government out then I still believe it to be theft. But those deposits were not secured. So if the bank does go belly-up the funds should be at risk. Maybe people will be more judicious with their money in the future if they realize this is the case.

However, this all pales in significance compared to the ramification of comments by Jeroen Dijsselbloem. In an article in the UK Telegraph Mr. Dijsselbloem is quoted as asserting,

If the bank can’t do it, then we’ll talk to the shareholders and the bondholders, we’ll ask them to contribute in recapitalising the bank, and if necessary the uninsured deposit holders.

He’s more than hinting that Cyprus’ solution could be a blueprint for other troubled nations in the Euro. And Mr. Dijsselbloem isn’t a minor figure in the cogs of Brussels, he’s President of the Board of Governors of the European Stability Mechanism. I cannot think of anything more destabilizing to Greece, Spain, Italy and even France than suggesting its citizens, with significant deposits, may need to cough-up for the mistakes of their banks. This will surely start the flood of cash out of the these countries and into Germany (if they’d like to keep their money in Euros), the UK or the US. The pain for the struggling nations will be too much and the end of the Euro, as we know it, will come.

The irony that the President of the European Stability Mechanism made these destabilizing comments is not to be missed. As is often the case, when governments set out to do one thing their actions often result in the opposite result.

]]>https://www.stevemaughan.com/politics/accelerating-towards-the-end-of-the-euro/feed/0478Radio 5 Live Interviewhttps://www.stevemaughan.com/politics/radio-5-live-interview/
https://www.stevemaughan.com/politics/radio-5-live-interview/#respondFri, 25 Jan 2013 01:05:16 +0000http://www.stevemaughan.com/?p=467Thanks to my good friend Tim Levell I was asked to comment about David Cameron’s speech on Radio 5 Live. It was really quite a short interview and Tony Livesey (the host) positioned me as part of the “brain drain” from the UK. I did manage to make some points. I’m on at 8 minutes 8 seconds and then again at 13 minutes 50 seconds:
http://maughanpersonal.s3.amazonaws.com/Cozmix/Miscellaneous/Steve%20Maughan%20-%20Radio%20Five%20Live%20on%20Cameron%27s%20Speech%20about%20Europe.mp3
]]>https://www.stevemaughan.com/politics/radio-5-live-interview/feed/0467Colossians 2 v 8-23https://www.stevemaughan.com/sermons/colossians-2-v-8-23/
https://www.stevemaughan.com/sermons/colossians-2-v-8-23/#commentsMon, 09 Apr 2012 13:10:03 +0000http://www.stevemaughan.com/?p=412Here’s the fourth sermon in the Colossians series:

]]>https://www.stevemaughan.com/sermons/colossians-1-v-24-2-v-13/feed/0401Pippa Learns to Ride a Two Wheel Bike!https://www.stevemaughan.com/family/pippa-learns-to-ride-a-two-wheel-bike/
Mon, 27 Feb 2012 03:43:58 +0000http://www.geocoding.co/?p=374She seems to be getting the hang of it quite quickly!