IECS Execution (Speed) Tests
So far, we have been testing the various Delphi versions using a simple Hello World application (described in the Introduction). The Hello World project is a simple application/app that provided some interesting comparisons between the different Delphi versions on various platforms. It showed the work that needs to be done to improve the FMX versions. However, the Hello World project is limited and truly only tested a couple “standard” controls (TListBox and TMemo). This week, we are going to show speed results from sample applications using the Inference Engine Component Suite (IECS). The IECS is a large component library (96K lines of engine code and another 48K LOC for dialogs) for developing expert systems with Delphi. It uses lots of interfaces, generics, parsing/string manipulation, and 100s of classes. It works from Delphi 2010 through XE6 and for all platforms that Delphi supports. It should provide very interesting non-visual execution results.
About the IECS Test Applications
The IECS test applications use the IECS components to solve expert systems, both with Fuzzy Logic and without. We are actually testing 3 demo projects that come with the IECS: IECS Advanced Console application (both VCL and FMX), IECS Basic Console application (VCL and FMX), and an IECS Mobile app (FMX for iOS and Android).
The IECS Advanced Console Application provides a GUI console for interacting and building expert systems. It contains input and output windows and listboxes that display the list of facts, fact templates, rules, and agenda items currently active in the inference engine. This application should provide a good mix of non-visual benchmarks with updates to TListBoxes and output to a TMemo and tests Win32, Win64, and OSX. Note that this is not a console program in the Delphi sense, but a console for interacting with the expert system. The IECS Basic Console Application provides a very simple GUI console for interacting and building expert systems. There is an input TEdit and an output TMemo, but no TListBox. The output can be controlled from a combobox: Live Updates print all output immediately as it occurs, Defer Updates defers all output until the current command is finished by surrounding output in BeginUpdate/EndUpdate, and No Updates suppresses all output and will just write execution time to a status bar.
This application is about getting the GUI out of the way and benchmarking non-visual performance with minimal GUI updates. However, as we will see, even little output to a TMemo wrapped in BeginUpdate/EndUpdate calls can have significant performance penalties, especially in FMX. This application is for Win32, Win64, and OSX. Note that this is not a console program in the Delphi sense, but a console for interacting with the expert system. The IECS Mobile app provides the simple GUI console for executing expert systems on iOS and Android. This app executes expert systems and can optionally send output to a TMemo.
Upon execution, all 3 applications execute a battery of expert system problems:
- Monkey and Banana Problem – Determine steps for monkey to eat a banana based on moving around a room, stacking furniture, etc to get to banana
- Word Game problem (GERALD + DONALD = ROBERT)
- Stacking Problem – Determine plan for stacking one block onto another
- Sticks Game – Win the game by removing 1 to 3 sticks per turn (from a starting pile of sticks) to leave opposing player with 1 stick at end (only in desktop simulations)
- Home Recommendation – return scores for different cities based on customer choices for average temperature, population, etc using fuzzy logic
- Product Design Match – returns scores for different products based on customer choices for cost and size using fuzzy logic
- Backorders – Simple calculation of backorders based on fuzzy customer order amounts (low, high, medium)
- Game Combs – Decide aggressiveness based on enemy health, our health, and distance
- Project Risk – Determine how risky a project is based on accumulation of evidence of duration, staffing, funding, complexity, priority, and visibility using fuzzy logic
The IECS Advanced and Basic Console applications load the expert systems from the file system. The IECS Mobile App has the expert systems embedded in the app in a TClientDataSet. This is a large blog post, so we have divided the speed tests into 3 sub-parts: