我的文章

C++ Memory Management Innovation: GC Allocator

FoldUnfold Table of Contents Introduction What is GC Allocator? Concept of GC Allocator A Better Smart Pointer Creating a GC Allocator and Allocating Memory Should Be Very Fast Another Way of GC GC Allocator Implementations: ScopeAlloc and AutoFreeAlloc Faster Than All Allocators You Ever Seen The Infrastructure of ScopeAlloc and AutoFreeAlloc GCAlloc: A Huge Stack No Multithreaded Locks When to use AutoFreeAlloc Open Source Applications based on GC Allocator A Word File Writer Rope based on GC Allocator STL Containers based on GC Allocator Related Topics To obtain a copy of this paper in pdf format click here (or from google code). Another copy is also available on codeproject in html format. Introduction Most of the C++ programmers do not benefit from Garbage Collection technique...

Allocators Performance Comparison

FoldUnfold Table of Contents Summary Test Cases Test Result on Linux Condition 1: Each allocator allocates one integer object Condition 2: Each allocator allocates 1000 integer objects Condition 3: Each allocator allocates 1000,000 integer objects Test Result on Windows Condition 1: Each allocator allocates one integer object Condition 2: Each allocator allocates 1000 integer objects Condition 3: Each allocator allocates 1000,000 integer objects Conclusion Summary In this article we'll talk about allocators performance. We take performance comparison of: AutoFreeAlloc ScopeAlloc APR Pools (Apache Portable Runtime) MT Allocator (GNU C++) Boost Pool (boost::pool) Boost ObjectPool (boost::object_pool) NewDelete (new/delete) Because most of allocators focus to improve performance of...

A Proposal of operator new with typeinfo

FoldUnfold Table of Contents Motivation Impact on the Standard Design Decisions operator new with typeinfo operator new[] with typeinfo Issues for Discussion I. Corresponding operator _delete Applications based on operator new with typeinfo I. A Debug Version of operator new II. A Region Allocator Proposed Text Motivation At present we can override operator new as follows: void* operator new(size_t size, ArgT1 arg1, ArgT2 arg2, ...) { return malloc(size); // just an example } Even though it is good enough, still I think something is missing here. For example, if I want to implement a debug version of operator new which reports the memory leak and the kind of objects leaked, I cannot get the class name of an allocated object. An operator new with typeinfo can solve this...

The Fastest Word File Writer

FoldUnfold Table of Contents Highlights Why it is fast? Full-featured Taking a fast look A better COM About the download resources Performance Highlights It's a fast, full-featured word file format writer. And It also can write RTF files (but I remove this function in the published version provided here). And this version is only for technology show. You can't use it in commercial way. Why it is fast? First, we use GC Allocator to accelerate memory allocation. Second, we create a DOM tree which its internal data structures is similar to word file format. It provides powerful APIs and reduces IO times. Full-featured Yes. it can write all word2003 functions such as rich text, font/stylesheet, bullet/list, header/footer, footnote/endnote, fields, bookmark, annotation, frame, table,...

Rope based on GC Allocator

FoldUnfold Table of Contents Introduction Source code Performance Comparison Introduction Rope is a complex string implementation with scaled performance. The original rope implementation is appeared SGI STL. I rewrite the rope class based on GC Allocator. Code size is much reduced and performance is better. Source code Source code of the original rope implemention: stl_rope.h ropeimpl.h Rope based on GC Allocator: RopeRep.h Rope.h RopeImpl.h RopeIter.h CharProxy.h SequenceBuffer.h I divided rope source code into six parts: RopeRep.h implements the underlying representation of rope data structure. RopeIter.h implements rope's iterators. CharProxy.h implements element reference proxy of rope containers. Rope.h/RopeImpl.h implements the rope class. SequenceBuffer.h implement...

Allocators Performance on STL Collections

FoldUnfold Table of Contents Summary Performance Comparison Conclusion Summary In this article we'll talk about allocators performance on STL collections. We take performance comparison of: std::deque, Deque based on ScopeAlloc std::list, List based on ScopeAlloc std::set, Set based on ScopeAlloc stdext::hash_set (GNU C++), HashSet based on ScopeAlloc std::map, Map based on ScopeAlloc stdext::hash_map (GNU C++), HashMap based on ScopeAlloc Performance Comparison Test Environment: CPU: Intel(R) Pentium(R) D CPU 3.40GHz (2 CPUs) Memory: 2G OS: Ubuntu 4.1.2-0ubuntu4, Linux version 2.6.20-15-generic Compiler: g++ (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2) Test cases: When testing performance of a value container (eg. deque, list, set, hash_set, etc), we insert...

Add a New Comment
or Sign in as Wikidot user
(will not be published)
- +

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License