Re: This calculation is just wrong / computer can't count!
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Wed, 10 Oct 2007 02:20:20 -0400
One of the true joys of being a self-employed consultant is that I don't have to work for
people like this.
I remember one "job interview" a few years ago; their in-house "expert programmer" was
designated to ask me some questions. The telling one was "what's the fastest way to
allocate memory?" and I said "new or malloc". He asked "no, seriously, what's the fastest
way to allocate memory?" and I replied "new or malloc". He aske the question several more
times, and finally gave up in frustration and said "VirtualAlloc!" I looked at him and
said "that is incorrect. It is not the fastest way to allocate memory". He insisted it
was. I asked him if he'd ever measured it. No, he hadn't. So why did he believe it was
the fastest way to allocate memory? "Well, it has to be" I could not explain to him that
a kernel call to allocate memory could not possibly be faster than unlinking an element
from a linked list without a kernel call. He remained unconvinced. I went back to his
boss and explained that I could not possibly work for someone with such a poor
understanding of reality. And, as the guy's manager, he had a serious problem because
this guy was going to create some really, really bad products. His boss was dismayed,
because he had hoped to hire me, but I was having no part of it. Anyone dumb enough to
think that VirtualAlloc is faster than malloc has some serious issues, and I'd have to
report to this twit. Turns out the guy was some ex-Unix programmer, and was still
thinking he was using the piece-of-crap Unix storage allocator. So I don't have to work
for idiots.
I did send his manager a program that measured performance of the two. It turns out that
VirtualAlloc can only allocate 64K segments, and it takes about 500 times longer than
malloc for small (1000-byte) blocks, and about 20 times longer than malloc for large
(65536-byte) blocks. So other than the fact that it was one to two orders of magnitude
slower and consumed vastly more memory (so it impacted paging behavior seriously, which
means that a page fault, which is only six or seven of orders of magnitude slower than an
L2 cache miss, is more likely) there was nothing wrong with using it. It's hard to argue
with actual performance figures.
I would not consider working for someone who was suffering from such severe rectocranial
inversion. The nice thing is, I don't have to; I can make money working for intelligent
people. They actually listen to what I say. And listen when I explain why something is
not a good idea. And they pay me. Lots.
joe
On Tue, 9 Oct 2007 17:53:08 -0700, "Ashot Geodakov" <a_geodakov@xxxxxxxxxxxxxxxxxx> wrote:
Funny part is, you have no idea whom you are arguing with in such tones. OneJoseph M. Newcomer [MVP]
day you may end up working for him... :)
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:ad7og3pku6cssog2m6r5r3hrjnh2tj4s4t@xxxxxxxxxx
You really are continuing to be terminally stupid. Why do you think that
the 7 represents
an error? It does not. The concept that it represents an error merely
represents your
failure to grasp reality. The reason is that the internal representation
is more precise
if that low-order bit is set.
Tell me: did you REALLY use the Floating Point Explorer to look at this
issue? It should
be obvious to you if you did!
You really keep missing the point. You confuse precision with textual
representaiton.
joe
On Tue, 9 Oct 2007 10:48:49 +0100, "GT" <ContactGT_remove_@xxxxxxxxxxx>
wrote:
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in messageJoseph M. Newcomer [MVP]
news:il4lg39b6gfidnmdpcn7lmgtnf4ao7u9vt@xxxxxxxxxx
What final digit? 25/30 has no final digit in abstract mathematics; if
you try to write
it down, you have to stop somewhere, and as soon as you stop, you
introduce an error.
You only introduce an error when you stick a 7 on the end. If you end with
a
3 then there is no error only a precision limit.
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- Re: This calculation is just wrong / computer can't count!
- From: GT
- Re: This calculation is just wrong / computer can't count!
- From: Joseph M . Newcomer
- Re: This calculation is just wrong / computer can't count!
- From: GT
- Re: This calculation is just wrong / computer can't count!
- From: Les
- Re: This calculation is just wrong / computer can't count!
- From: GT
- Re: This calculation is just wrong / computer can't count!
- From: Les
- Re: This calculation is just wrong / computer can't count!
- From: GT
- Re: This calculation is just wrong / computer can't count!
- From: Joseph M . Newcomer
- Re: This calculation is just wrong / computer can't count!
- From: GT
- Re: This calculation is just wrong / computer can't count!
- From: Joseph M . Newcomer
- Re: This calculation is just wrong / computer can't count!
- From: Ashot Geodakov
- Re: This calculation is just wrong / computer can't count!
- Prev by Date: Re: help on Indexing contents in file
- Next by Date: Re: This calculation is just wrong / computer can't count!
- Previous by thread: Re: This calculation is just wrong / computer can't count!
- Next by thread: Re: This calculation is just wrong / computer can't count!
- Index(es):
Relevant Pages
|