473,387 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

STL pool allocator performing very slow!

12
Hi All,

I've created STL allocator which creates memory pool in the beginning, and all maps and vectors will take memory from that memory pool.

But...I am observing that application has become drastically slow.
I was under impression that after implemeting pool, application will fasten, but it is doing other ways.

I've implemeted doubly linked list to maintain the nodes occupied or free in the pool.

My C++ application was able to insert 40000 records in Oracle DB in 5 min. if they use default allocators, and now it can only insert 5000 records.

Has anybody faced this kind of problem with custom allocators of memoty pool.
-Thanks
-Mavrik
Apr 9 '08 #1
6 2732
weaknessforcats
9,208 Expert Mod 8TB
It's probably the linked list that's the problem. Try implementing a heap. That is, a tree where the distance from the root to farthest leaf nodes is constant.

You have to avoid traipsing about in a linked list when managing memory. You don't have the time luxury.
Apr 9 '08 #2
mavrik
12
It's probably the linked list that's the problem. Try implementing a heap. That is, a tree where the distance from the root to farthest leaf nodes is constant.

You have to avoid traipsing about in a linked list when managing memory. You don't have the time luxury.
Hi.. Thanks for ur response.
I am not able to understand that how to go ahead with Tree implementation.
I also want to understand what u mean by saying "the distance from the root to farthest leaf nodes is constant".
Can u elaborate it... also guide me how to design it..
Thanks a lot..
Apr 10 '08 #3
weaknessforcats
9,208 Expert Mod 8TB
Check out Algorithms in C++ by Robert Sedgewick ISBN 0-201-51059-6.

What you want be between pages 148-183.

The examples are all in C++.
Apr 10 '08 #4
mavrik
12
Hi Weaknessforcats,

Can you help me in getting this book "Algorithms in C++ by Robert Sedgewick ISBN 0-201-51059-6".
Actually this book is very very costly on Amazon. And I can not afford it right now.
I could not find a softcopy over net.

If you have this, can I get a soft copy from you??
Thanks
Apr 25 '08 #5
weaknessforcats
9,208 Expert Mod 8TB
It's copyrighted material. There are legal issues around making copies of copyrighted material and failing to pay the author.

Have you tried the public library?
Apr 25 '08 #6
mavrik
12
Hello,

No I did not try public Library....Anyways thanks a lot for all the help you have provided so far.

-Thanks
May 6 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Philip Lawatsch | last post by:
Hi, I have some questions about whats written in http://www.parashift.com/c++-faq-lite/dtors.html#faq-11.14 (Describing some memory pool) #1 From what i understand this will also work for new...
8
by: ra294 | last post by:
I have an ASP.net application using SQL Server 2000 that every once in a while I am getting this error: "System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to...
0
by: roni schuetz | last post by:
since a few day's i'm running around the problem that I stocked with a change i need to do. hopefully somebody here can give me a tipp which will be usefull to solve my problem. I'm using a...
2
by: Jerry Adair | last post by:
Hi, I have been playing around with the suggestions and code shown in http://www.parashift.com/c++-faq-lite/dtors.html#faq-11.14 regarding memory allocation/deallocation (mem pools). I...
0
by: joe | last post by:
I have created a custom allocator for a multiset, and I am having a problem it seems because while the allocator has memory available to be used which is returned, the objects are never constructed...
11
by: Grey Alien | last post by:
I am looking to write a very simple memory pool library to store only one data type at a time - i.e. to provide a contiguous block of memory to be alloc'd free'd by the calling program. I am I...
6
by: Juha Nieminen | last post by:
I tested the speed of a simple program like this: //------------------------------------------------------------ #include <list> #include <boost/pool/pool_alloc.hpp> int main() { typedef...
16
by: graham.keellings | last post by:
hi, I'm looking for an open source memory pool. It's for use on an embedded system, if that makes any difference. Something with garbage collection/defragmentation would be nice. It should have...
17
by: a_linux_user | last post by:
I am creating a large graph object in which I add nodes whenever I need them, and I create them by 'new node' individually. I know this is slow if I am going to allocate thousands of nodes...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.