Comments (8)
I have been able to implement some iterators for my custom pointer vector but i still have the chrono timing bug.
But if the time is correct then a vector of pointers is faster than a vector from array sizes of 128. But i cannot really compare it to the other errors because of the timing error.
from articles.
I have solved it by explicitly setting the duration to 0 .
The benchmarks of my wrapped pointer vector show that it is faster than a vector at random insert from size 128. i will soon run all the tests.
But i think the pointer vector could be faster if i could somehow pre allocate reserved space. for example with a memory pool but i geuss this is too complex for me now.
from articles.
Hi,
Sorry about that. I've slightly changed the timing function, it should not have these weird numbers anymore. Could you check again ?
Yes, it is likely that if you reserve the memory in a single block, it will be faster because of very good data locality of the pointers.
from articles.
yea i used the same solution aswell to solve the chrono problem. i have the results in, the ptr vector seems faster than a linked list. But i guess the vector implementation is verry naive since it only allocated on an incert like a linked list and i am certain it could be made faster with a memory pool instead like a vector or deque. So then the performance would probably be between a deque and vector. except the fill back. the graph is html but github doesn't support it.
graph.txt
here is the naive ptr vector implementation. i quess i learned a thing or two from using you highly templated benchmark.
pointer_vector.txt
from articles.
Maybe in the future when i'm better at programming C++ i could program my own pointer vector where which uses an allocator to pre allocate a memory block for the container. So the container becomes less naive and has some capacity reserved.
from articles.
If you use vector as an underlying implementation, you at least have memory reserve for the pointers, but indeed it would probably be faster to have a memory pool for the objects themselves, but this is not trivial work.
I don't get the difference between const_iterator and iterator in your implementation. You use *a in iterator (which seems correct) for operator and &a in const_iterator. Otherwise, it seems quite good
from articles.
Yea i should come back later to it if i ever need it. But i guess a ponter vector + memory pool is almost like a deque in its structure but with more direct acces.
But the iterators do not implement enough for the c++ sort method. and thank for the complement.
from articles.
I'm closing this issue, please reopen if there are still problems with this.
from articles.
Related Issues (10)
- typo: std::lock_guard<std::mutex> guar(mutex); HOT 1
- minor update to condition_variable example HOT 2
- Copy-past mistake HOT 1
- fold_sum_1, fold_mul_1 need init value for null parameter case HOT 1
- build fails HOT 3
- Graphing documentation? HOT 5
- Build fails :( HOT 2
- build fails, HOT 2
- make failed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from articles.