RESOURCES

SEQUENTIAL SORTING UNDER 64-BIT

 

Sequential sorting under 64-bit

The 64-bit environment and its benefits for sequential sorting

To demonstrate scalability's effect on performance, we compared the time it takes to perform a sequential sort using the 32- and then the 64-bit versions of 4D Server v12. A sort needs memory to store the temporary data used in comparisons. 4D Server does not use the cache for this kind of operation; it allocates the memory in the “engine memory” (any part of the virtual memory 4D Server can allocate outside the cache). We set the size of the cache to the same value in both environments. If the need for temporary memory becomes huge, the 32-bit version will not be able to allocate it in the physical RAM, and the OS will swap memory on disk. When you say swap, it means slow: Whereas disk access is measured in milliseconds, RAM access is measured in microseconds. In its 64-bit version, 4D Server will find all the memory it needs for a sort in RAM.

 

Protocol

We use a simple structure: One table, one field. It is a non-indexed alpha field. The table holds 7,500,000 records. In each record, the field has a length of 50-100 characters. The data file has a size (on disk) of 3.2 GB, and the size of the cache is set to 2 GB (the whole data file does not fit in the cache).

 

On the server side, the machine is a Dell, Intel Xeon, 2.67 GHz, 6 GB RAM, running Windows 7 64-bit. The 4D remote client  runs on Mac OS X on an Intel Core 2 Duo processor.

 

All the records are sorted (ALL RECORDS, then ORDER BY). As the table contains many records, the need for temporary memory will be huge.

 

Results

Here is the time it took to perform the sort (it is an average of the same operation launched several times):

 


Sequential ORDER BY – 7,500,000 records. Time in seconds.

 

The 64-bit version is 8 times faster: The cache size is the same in both versions, but the 64-bitsversion could find in RAM all the memory it needed to perform the sort, while the 32-bit version has a limit of 1.5 GB (4 GB max, minus 2 for the cache, minus 500 MB for system libraries and other objects used internally by 4D Server).

 


Total Virtual Memory used by the 32-bit version: The max of 4 GB was reached.



Total Virtual Memory used by the 64-bit version: The max of 6 GB was not reached.

 

Thus, just moving from 32- to 64-bits can increase the speed of an application, without changing a single line of code. This is scalability.


 


 

 

More resources