我的文章

GC Allocator Summary

FoldUnfold Table of Contents C++ Memory Management Innovation: GC Allocator A Word File Writer Rope based on GC Allocator STL Containers based on GC Allocator The Fastest Word File Writer C++ Memory Management Innovation: GC Allocator Link: http://www.codeproject.com/KB/cpp/gc-allocator.aspx Highlights: The tiniest, fastest allocator and easy to use. And it became a boost sandbox library on 2008-04-29. I'm preparing for a peer review. It is easy to use: Like GC languages (eg. Java, C#, etc), it is no need to delete allocated objects by using GC Allocator. It is faster than all allocators you ever seen: For the detail information about the comparison, see Allocators Performance Comparison . Why GC Allocator is so fast? It benefits from: Its good allocation algorithm. No...

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...

Dive into GC Allocator


A Proposal to Cancel Overriding the DEFAULT operator new/delete

FoldUnfold Table of Contents Motivation Impact on the Standard Proposed Text Motivation I don't think we need to override the DEFAULT operator new/delete. This makes your code doesn't work well together 3rdparty code (if it also overrides them). Why overriding the DEFAULT operator new/delete is bad? Allowing to override the DEFAULT operator new/delete means the DEFAULT operator new/delete are special operators. When we have more than one implementations of an operator, the compiler/linker will report a redefining error. However, it allows there are two implementations of the DEFAULT operator new/delete (one of them is implemented as default). It sounds good. But, This gives a hint that there may have many implementations of the DEFAULT operator new/delete. When this happens, the...

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...

page 6 of 6« previous123456
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