Overview
TeeBI is designed for ultra-fast data processing through its array-based architecture. Every column or field is stored as a simple contiguous array, providing optimal memory locality and cache performance.Array-Based Architecture
Column Storage
TeeBI stores data in columnar format, where each column is represented as a native array:Performance Benefits
Memory Locality: Contiguous array storage means better CPU cache utilization and faster memory access patterns. Pointer Math: Enabled with{$POINTERMATH ON} for direct pointer arithmetic on arrays, avoiding overhead.
Precision Control: Uses {$EXCESSPRECISION OFF} on x64 for faster floating-point operations with acceptable precision.
Native Types: Uses TInteger = NativeInt to automatically optimize for 32-bit or 64-bit architecture.
Hybrid Sorting Algorithms
TeeBI uses optimized sorting algorithms combining QuickSort and InsertionSort:- QuickSort for large segments
- InsertionSort for small segments where it outperforms QuickSort
- Automatic algorithm selection based on data size
Speed Benchmarks
See the Speed demo for performance comparisons with other data structures.Key Performance Metrics
- In-Memory Operations: Direct array access without abstraction overhead
- No Dependencies: Pure Pascal RTL implementation, no database server required
- Zero-Copy: Many operations work directly on array pointers
Best Practices
Pre-allocate Memory
When building large datasets, pre-allocate array sizes to avoid repeated reallocations:Use Appropriate Data Types
Choose the smallest data type that fits your needs:- Use
Int32instead ofInt64when values fit in 32 bits - Use
Singleinstead ofDoublefor reduced precision requirements
Leverage Parallel Processing
For large datasets, use parallel operations (see Parallel Processing).Enable Compression
When persisting or transmitting data, use compression to reduce I/O time (see Compression).Performance Monitoring
Use Delphi’s profiling tools to identify bottlenecks:- Sampling Profiler: Available in RAD Studio
- Stopwatch: Use
TStopwatchfromSystem.Diagnostics
