Skip to content

Commit b6560cc

Browse files
authored
Update README with performance comparison notes
Added important notes on performance comparisons between TLSF allocator and standard malloc().
1 parent 8d38702 commit b6560cc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,25 @@ The actual free blocks are maintained within doubly linked lists, and the head o
111111

112112
## Performance Metrics
113113
Benchmarking was done using Google Benchmark and you can see the code used to bench mark in `benchmark` folder.
114+
115+
### Important Note on Comparisons:
116+
117+
Comparing this TLSF allocator against the standard library malloc() (the system allocator) is not a fair comparison due to fundamental architectural differences:
118+
119+
* **Scope of Management:** This TLSF implementation manages its own pre-allocated memory pool and avoids all operating system overhead (like kernel system calls) during run-time allocation.
120+
121+
* **System Interaction:** The standard malloc() is designed for general-purpose high throughput and often has non-deterministic latency. While most small allocations are handled rapidly in user-space, `malloc()` must periodically rely on system calls (such as `brk/sbrk` or `mmap`) to acquire memory from the OS. These kernel operations cause significant, unpredictable overhead that a pre-allocated pool-based allocator is designed to eliminate.
122+
123+
* **Conclusion:** If this TLSF allocator were forced to make system calls for some memory request, its performance would also be substantially slower. The benefit of this allocator lies in its O(1) low-latency guarantees within its managed pool.
124+
125+
**A fair comparison would be comparing it against other TLSF allocators or similar dedicated pool-based, low-latency allocators.**
126+
114127
![performance line plot](https://aka411.github.io/tlsf-memory-allocator/performance_line_plot.svg)
115128

129+
### Output Files
130+
131+
* [Download Raw Benchmark Data (JSON)](https://aka411.github.io/tlsf-memory-allocator/data/benchmark_result.json)
132+
116133
## Prerequisites
117134

118135
To build and run this project, you will need the following tools and dependencies installed on your system.

0 commit comments

Comments
 (0)