It uses at least two pointers (but actually 3) to store its state, that's already enough to say everything.
Announcement
Collapse
No announcement yet.
Google Announces The Tink Crypto Library
Collapse
X
-
Originally posted by computerquip View PostInstructions are not cached in the cache line.
Originally posted by computerquip View PostThe cache line has absolutely nothing to do with instructions being called, it has to do with how memory is accessed. This isn't even something complicated, you can literally google this and this is the first result you'll get https://en.wikipedia.org/wiki/CPU_cache#Cache_entries
Are you serious?
Most modern desktop and server CPUs have at least three independent caches: an instruction cache...
It uses the exact same mechanism to pull instructions into the cache lines, 64 bytes at a time.
Originally posted by computerquip View PostEDIT: Actually, I should say that the cache line has very little to do with instructions rather than absolutely nothing. Technically, the CPU will store instructions into *a* cache *though not one you can generally control actively*.
It's the same with data. And you know the funny thing is if you look at the standard library it doesn't even align the data often. Not a single bit of such "low level optimizations" which btw YOU brought up not me. I never even once even mentioned assembly language in a claim. You brought stuff you've no clue so...
Originally posted by computerquip View PostMost things that you can do to optimize this are already done by the compiler (loop unrolling, map lookup for switch and if-statements, inlining code automatically).
Of course, it's a moot point for vectors, which are very basic. They're required to be contiguous (i.e. a dynamically allocated array) so there's little "optimizations" you can do there. Even there, a std::vector is bloated in its inline members (what gets stored in the std::vector itself, not what it allocates). It's insignificant, but it's still worse than a hand-coded solution, and that's all that matters.
Like I said before, I never claimed it's a significant advantage to code your own, I merely stated that 1) the standard library is usually worse than what you can code yourself (but again, usually insignificantly worse), and 2) most C++ "programmers" are incapable of implementing those well-known algorithms themselves. Point 2 is the claim I made, and why C++ is made horrible by those people using it. With no special hacks or anything, it's not like the standard library uses them.
I never claimed you have to use low-level hacks to beat the standard library. I never even said you have to beat it in performance significantly!
You claimed and assumed like a lot of morons on stack overflow that the standard library uses "every low level hack out there in existence" which is beyond wrong and full of shit assumption. You claimed it's way faster than what you can code, and that's the claim I called bullshit on pal. (see post below)Last edited by Weasel; 15 September 2018, 10:40 AM.
Comment
-
Originally posted by computerquip View PostPROVE TO ME this is a problem. Give me a benchmark that shows this to be true.
However, that's beside the point. You are the one who claimed this:Originally posted by computerquip View PostAlgorithms provided in the standard library are often better than what most can write by themselves without a PHD and a white paper to stare at for hours to weeks.
Of course, it's not going to do significantly worse, either. But I never claimed that buddy.
Comment
Comment