Performance Tips

Manifold is designed for an era where processor cores, disc drives and memory are cheap but human time is expensive.    

 

That's why Manifold .map files will generally be significantly larger than the sum of the file sizes of files that have been imported into the .map file:  by pre-computing essential relationships, such as indexes, and storing data for speed rather than compactness the larger .map file provides significantly faster performance and saves us a lot of time.

For best performance with larger projects:

 

Recent versions of Windows such as Windows 10 are much faster and more stable than earlier versions of Windows.  Not only Windows itself is faster but also accessory subsystems, such as DirectX rendering, that are used by Manifold are also much faster than earlier subsystems.

 

Modern Windows editions provide many power saving options, even on desktop machines that are plugged in all the time.  Surprisingly, the default choice might be a Balanced plan that reduces performance to reduce energy consumption.   By running the processor slower or by turning off disk drives a power plan can significantly reduce energy consumption, but at the cost of significantly reduced computer performance.

 

For maximum performance with Manifold, make sure your power plan is set to High performance.  Ensure that in whatever power plan settings have been specified, all disk drives that you will be using are never turned off, since the time to turn on a disk drive and spin it up for full readiness can result in dramatically slower operation.

 

Although Manifold has remarkably good performance in systems which are under-equipped with memory, the system can do better if we have installed lots of cheap memory in our computer.   Think big: many desktop computers and motherboards as of this writing can host 128 GB or more of memory.

 

If we have lots of memory in our system Manifold can minimize the need to utilize much slower disc drive storage.   Disc will still be used: there is no getting around the need to get data off disc and into memory and no matter how fast Manifold may be Windows will impose a limit on how fast disc drives perform.  Therefore it pays to use faster disc drives and to use solid state disc, SSD, drives for maximum speed.  More memory is more important than faster disc drives, so better to spend the same amount on increasing RAM from 32 GB to 64 GB or 128 GB than to buy a smaller, but fast, SSD instead of larger, reasonably fast disc drives.

 

Having more memory is also usually a higher priority than buying the fastest possible CPU.   Having a fast CPU is nice, of course, but if the faster CPU spends most of its time waiting for data to be fetched from infinitely slower disc drives the funds invested in a super hot CPU will have been wasted.   For most applications a reasonably multi-core CPU with average or above average speed is fine.

 

In many tasks having a CPU with many cores that are average speed is better than having a CPU with fewer cores which are faster cores.  The classic example is installing an inexpensive 8 or 10 core processer that ends up delivering better performance than an expensive 4 core processor.

 

Manifold utilizes NVIDIA GPUs for GPGPU processing to achieve much better performance through massively parallel computation, where such computation makes sense, primarily with rasters.   Modern GPUs are so fast, however, that even if Manifold feeds the GPU with multiple, parallel streams taking advantage of CPU parallelism to fetch data from memory and dispatch to many GPU cores there are few situations where the rest of the computer can keep up with many GPU cores.   

 

The result is that even average, inexpensive, GPU cards will spend most of their time waiting for the rest of the system to catch up.  If we purchase a "good value" GPU card instead of the most expensive GPU card we therefore will maximize the performance we get compared to funds expended.   If funds are unlimited then, of course, we can spend big and buy whatever is the latest, hottest GPU card or, better still, buy as many of them as will fit into our computer.   But in most cases having one or two relatively inexpensive but also relatively recent GPU cards will provide performance that is not noticeably slower.   

 

When GPU makes a difference almost any NVIDIA GPU delivers big results.   Therefore, all systems for Manifold should have at least some GPGPU-capable NVIDIA GPU in them.  Even the cheapest GPGPU-capable card is better than none.

 

It should go without saying that we should be working with 64-bit Windows on a 64-bit computer.   Manifold can be surprisingly quick even within the limitations of 32-bit Windows but in modern times we should try to avoid crippling our productivity by utilizing 32-bit architectures that became obsolete almost 20 years ago.

 

tech_ravi_sm.png

Tech Tip: In queries use THREADS to make full use of processor cores available.  

 

The THREADS command takes a value for the number of threads to use.  For example, if we know we have six CPU cores but we only want to use four threads we could write...

 

THREADS 4

 

To automatically use however many CPUs we have available we can add...

 

THREADS SystemCpuCount() BATCH 1

 

...to the end of a query we are telling Manifold to see how many CPUs are available, the result of SystemCpuCount(), and to use that many threads.   The result can be dramatic, literally running a query several times faster than without launching multiple threads.

 

Performance and File Formats

Manifold can seem to work miracles even with slow formats.  For example, Manifold .MAPCACHE techology allows Manifold to link large ESRI shapefiles or MapInfo MIF files into a project and to open and render them even faster than ESRI's own ArcGIS shapefile rendering software or MapInfo's own software.  At times Manifold can even render and edit large linked shapefiles or MIF files with speed approaching that of Manifold's own .map format.

 

In most cases the fastest possible setup is to import data into a project and to work with the .map project file in local storage, such as fast, local RAID hard disk storage or a fast, local SSD.   Manifold working with Manifold .map format usually runs faster than disks can serve data so in the case of projects involving lots of data the faster the disk storage, the better.  Even better is to have lots of cheap main memory so the system does not have to touch disks drives as often.

 

Manifold can also do read/write work with many data formats without importing the data but working with it while it is linked from and still residing in the original file format.  That's great for casual use like editing some data "in place" in the original file but it may not be as fast as native Manifold .map storage.

 

The convenience of editing an older format "in place" may make the limitations imposed by that format tolerable for small projects; however, as a general rule of thumb it is a better idea to import the data into the Manifold project, save it in a Manifold .map file and then if need be export it back out to the older format.   That's true even though there is overhead required in the time necessary to import data into Manifold and then time again required to export the data back to the original format.

 

Better still is to import the data sets that we may frequently use into Manifold .map format and then work exclusively with .map format as much as possible, exporting to other formats only when necessary to send data to someone who does not have Manifold.

 

See Also

Getting Started

 

How to Edit a Single File

 

The MAPCACHE File