I guess im the only one who [would be]/is stupid enough to reinvent the wheel, mainly ive written my own "containers" cause of the ugliness of stl, i mean its a very ugly library in my opinion.
What should I use? my containers or STL?
ap from above.
If thats the case then I should have a job!
quote:
Correct me if I''m wrong, but the STL is very fast. It was made by a bunch of really smart dudes, and If you can implement your own containers or whatever you need and acutally have them faster than the STL, then you should have no problem getting a job just about anywhere (programming I mean).
In other words, dont try to make your own in the hopes that it will be faster, unless you know an AWEFUL lot about the subject. In which case you probably wouldnt have asked this question...
If thats the case then I should have a job!
quote:Original post by merlin9x9quote:...but in a tight loop, the STL rarely performs better than well optimized C-style code.
Except for std::string , this completely contradicts my experience; the STL is implemented with well-optimized code.
[edited by - merlin9x9 on October 21, 2003 3:24:20 PM]
I just finished writing a Turing machine for a school project. Same code, one using an STL vector (gcc 3.2.2) the other using an array and pointer arithmetic (good since the tape head only moves one square at a time) was on the order of 10x faster in the tight loop. Profiling the code brought to my attention that every call to operator[](int) incurred a call to *(const_iterator), which brought with it far more instructions than *p ever will.
Like I said, in a tight loop (one where you care how many instructions are actually executed), the STL usually won''t be faster. And in my case, on large inputs that traversed the tape in both directions, it was several minutes slower.
The crazy thing about STL is that all the implementation is right there in the headers, but no one can actually read it...
their coding style is ugly as hell and I cant belive how they ever could come up with such ugly coding style for a "standard" library. I mean shouldnt the coding style also be "standard"?
If general people would write code like that, or if I would do that, I would be fired without any hesitation by my employer.
If general people would write code like that, or if I would do that, I would be fired without any hesitation by my employer.
It''s actually very easy to code like that. You write it however you want, then you run a regular expression based replace that simply removes all the whitespace
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement