Re: bytes To Hex
- From: "Analizer1" <dvs_bis@xxxxxxxxxxxxx>
- Date: Wed, 6 Feb 2008 09:56:47 -0800
i was able to read your sample code..
thanks again, and i agree about long loops.
if i have a long loop ..i tend to do as little stack pops as i can
tks
"Jeroen Mostert" <jmostert@xxxxxxxxx> wrote in message
news:47a8f7ee$0$85778$e4fe514c@xxxxxxxxxxxxxxxxx
Peter Duniho wrote:
On Tue, 05 Feb 2008 13:21:54 -0800, Jon Skeet [C# MVP] <skeet@xxxxxxxxx>Oh dear. I sort of figured that would happen. But really, you probably
wrote:
Analizer1 <dvs_bis@xxxxxxxxxxxxx> wrote:
this was my 1st Run at this type of conversion...
so your remarks are welcome...
I Want The Fastest and Tightest Conversion Possible
don't.
I know I was being evil by talking about fast code for that (since peopleWhy, out of interest? Just how many of these are you doing? Do you have
specific performance goals in mind? If you're getting the data from
directory services, that's likely to be much, much slower than any of
the conversion mechanisms given here.
Agreed. Jeroen's version is an interesting exercise, but it should
almost never be the case that one would actually need code written like
that.
get obsessed with "the fastest code" too easily), but I couldn't help
myself. I did point out that it's highly unlikely that formatting
hexstrings would be a bottleneck for anything. For one thing, you will
presumably want to *send* those hexstrings somewhere, and then you run
smack-dab into I/O, which tends to bottleneck a lot more.
Writing code that's comparatively difficult to understand like that isNow here's where I'm slightly offended at the suggestion of producing
only something you should do once you've tried a readable version and
found it to be _the_ bottleneck performance-wise.
unreadable code. Most C programmers would agree that my version is a
paragon of readability. :-D
Also, my comment on not using String.Format() in loops if it's obvious to
avoid still stands (and in this case, using BitConverter is pretty
obvious, and fast to boot as a bonus). Extensive string manipulation *can*
become a bottleneck fairly quickly, or even just a noticeable drag, and
StringBuilder isn't a cure-all for string performance problems.
--
J.
.
- References:
- bytes To Hex
- From: Analizer1
- Re: bytes To Hex
- From: Peter Duniho
- Re: bytes To Hex
- From: Analizer1
- Re: bytes To Hex
- From: Jeroen Mostert
- Re: bytes To Hex
- From: Analizer1
- Re: bytes To Hex
- From: Jon Skeet [C# MVP]
- Re: bytes To Hex
- From: Peter Duniho
- Re: bytes To Hex
- From: Jeroen Mostert
- bytes To Hex
- Prev by Date: Re: bytes To Hex
- Next by Date: 64 bit configuration
- Previous by thread: Re: bytes To Hex
- Next by thread: Re: bytes To Hex
- Index(es):
Relevant Pages
|