oktronic,
although this discussion is somewhat running on the spot, I'll try to answer once more. The problem I (and I think others as well) have with your kind of argumentation that you hardly ever get to the point which is actually being discussed. You keep saying that others are wrong, whithout further explaining why.
What about the different levels of abstraction you are deliberately intermixing? Any comment on that? What about the fact that the links you posted are about low level memory management issues at the hardware / OS level, but have nothing to do with algorithms and their complexity?
Until now, you still didn't make your point very clear. You started out by claiming to have a self-implemented vector template class which can be used as a drop-in compatible replacement for std::vector, yet being more readable in code, and performing better than std::vector and CArray. However, what you showed us was the implementation of a linked list (rather to be compared to std::list than std::vector), so your benchmark, which used tail insertion, was completely meaningless. Furthermore, it has been pointed out that your class is not compatible with std::vector for several reasons. A more meaningful benchmark test conducted by Kevin showed that your class performed somewhat near to std::list (which was to be expected), and was about 10 times slower than std::vector with a pre-allocated size (which is also within the normal range of expectation).
However, you completely ignored those facts, only stating that std::vector is also a linked list implementation (which has been proven wrong), and that your class would perform the same as std::vector if only pre-allocated memory was used. Now, pre-allocating memory makes sense for an array, but not for a linked list, and it remained completely unclear how memory should be "pre-allocated" for the class you posted so far.
Instead, you diverted the discussion to how virtual memory is handled at the hardware / OS level, something completely unrelated to the original subject. You posted two links to what you called "documentation", but there were only slides meant to accompany a basic class on OS design. You still didn't comment on that, leaving everyone with the impression that you fail to perceive the fundamental difference between virtual memory management at the hardware level and data structures at the software level.
I apologize if I sound a little harsh now ;), but most of the statements you made so far (and also some technical terms used in a slightly out-of-place manner) have the smell of hot air, and leave the impression that you have not the slightest of what you are talking about.
So your posts to this thread so far leave everyone puzzled: Did you just want to add some noise, or do you really have valid arguments to contribute? If so, you should rather lay them out clearly, instead of just making doubtful claims.
Oh, and yes:
Quote:
Originally posted by oktronic
I wasn't comparing it to a linked list.
Yes, you were, as your original statement leading to this quote was "can you explain to me why using my own list is more inefficient then iterating through system memory list to the 50th element?". Here's why: "my own list" in this context means your linked list implementation, and "iterating through system memory list" was the way you claimed to understand how array elements were accessed.
Quote:
Originally posted by oktronic
Exactly, I was hoping Kevin picked that up, that's why I set that up for him since he didn't seem to understand.
What do you mean by "set that up for him"? You mean you intentionally made a wrong statement as sort of a bait, to have him pick it up? My impression is that Kevin understood very well what he's talking about, while your preceding statement about adding a value to a pointer and dereferencing it showed, once again, a severe misconception about the entire subject.
Quote:
Originally posted by oktronic
That's one of the differences between array iteration and ptr. Its 1 operation to get array address, one addition to new address, 1 operation to get value from address.
However for a simple de-reference, its 1 to get address, 1 to get value. Which is one less operation, so its faster. Which is the point for pre-allocated memory.
No, no, again. The point about arrays is that you can randomly access any element in constant time, not just iterate through it. The cost of iterating an array vs. iterating a list is always linear, and only differs in details. It might be a little faster or a little slower, depending on the actual implementation. Complexity comes in only when you have to access an arbitrary element.
Quote:
Originally posted by oktronic
Twice now I have asked you to simply modify the code Kevin provided and pre-allocate memory for it. So please do so and you will see the results for yourself making this argument moot.
As already said above: pre-allocating memory makes sense for an array, but not for a linked list. Kevin already had to make guesses and anticipate your linked-list code in order to run his benchmark. How would you want him to implement something as a pre-allocation scheme (which is meaningless for a linked list) for your class?
Quote:
Originally posted by oktronic Actually, Since you seem to have a interesting understanding of the concepts, you should read the second document provided. Its more advanced then the first, but I think you should be able to understand how a page system works. You made several incorrect points about the system, but I think you're able to understand them so I would suggest picking up an advanced operating design book next time you're out.
Thank you. The second "document" you mention is a slide show which reminds me of the material presented at my undergrad OS design class 15 years ago. Nice slides, but, as said above, completely unrelated to the discussion in this thread. The thread's original subject was somewhat like "I hate STL, I prefer MFC containers", and, as expected, led to heavy debates on that topic. Your contribution first sounded like "I roll my own STL replacement, which is much better", but then you failed to show how and why, and the discussion diverted into complexity considerations for arrays vs. linked lists, as you seemed (and still seem) to completely ignore that important point. Instead, you brought up the links to the OS design slides, which, I say it again, have no relevance to the original topic. That maneuver just showed your concepts about memory, addresses, pointers etc. to be rather diffuse.
Quote:
Originally posted by oktronic
Read them all, got them in my library. Meet Knuth here at Stanford. I should mention I live in the Bay Area and have done some work there.
Wow, impressing. Look, I have been living in Verona and heard Placido Domingo at the Arena, but that doesn't make me a tenor. I've met Marvin Minsky and Joseph Weizenbaum, but that doesn't make me an AI philosopher. Reading their works, however, can give you a slight idea. So if you've really read Knuth, are you sure you also understood what you read?
Quote:
Originally posted by oktronic
What kind of bothers me a little, is you quote his book and yet I don't think you know what's in them. So I will suggest the same thing to you, read them and then quote them. But please don't just quote any random books to try to make a point. If you have specific points you feel these books illustrate, then quote the points at least then I might get to see that you understand the point you are making.
So if you've got them in your library, just pick up Vol. 1, "Fundamental Algorithms" and turn to page 244. Read chapter 2.2.2, "Sequential Allocation" and the following chapter 2.2.3, "Linked Allocation". After that, come back and tell us if you still support the statemets you made above about arrays and linked lists.
Quote:
Originally posted by oktronic
While you are about 60% right in your post, there's a lot of holes and I could go on about this for months, operating system design can be a lot of fun and a lot of irritation, but in the interest of this thread, please just add pre-allocated memory to Kevin's class and run your benchmark. If you have any problems with that let me know and I'll explain.
Yes, OS design is fun, but again, as said above, is not related to the subject here. As to the pre-allocated memory, see above.
Quote:
Originally posted by oktronic
But please, less telling everybody that they are wrong and more time proving your points.
Note that I'm not "telling everybody that they are wrong", but that several posters here are having a hard time trying to convince you that you're actually missing the point. I think I proved my points more than enough. Just read what I wrote and go into it instead of just ignoring the key arguments.
Quote:
Originally posted by oktronic
I have handed you the ability to prove me wrong, use it.
I think I sufficiently did so... ;)