Re: Tough question on database NULLs.

Tech-Archive recommends: Fix windows errors by optimizing your registry



When a function is JIT compiled, the compiler 'interns' all the strings in
it and uses a single instance of each unique hard coded string for that
function. Empty strings are replace for string.Empty at this point. The
reason string.Empty exists is because string is a reference type, it saves
memory only having one copy of an empty string object in memory.

Ciaran
There are 10 types of people in this world, those that understand binary,
and those that don't.

"Mark Wilden" <MarkWilden@xxxxxxxxxxxxxxxxx> wrote in message
news:u%23EwC8EpGHA.5104@xxxxxxxxxxxxxxxxxxxxxxx
"Michael Nemtsev" <nemtsev@xxxxxxx> wrote in message
news:1799a79b39e84f8c87281c96a3568@xxxxxxxxxxxxxxxxxxxxxxx

PS: use == String.Empty in lue of == ''

I've heard this recommendation before. What is its rationale?

///ark



.



Relevant Pages

  • Re: Fast string operations
    ... Looping: I thought looping over arrays in managed code was "slow" ... array handling and such. ... The problem with TrimHelper is that it always returns a new string instance. ... The customer perceives this as a memory leak. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Discovering variable types...
    ... >- but I suppose MS expect us to use wrappers ... memory allocations for your variables from disk as well. ... >They most certainly are of fixed size, changing the size of a String ... >>me to keep buffer size and current postion right in the memory block. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Optimize
    ... if you use it like me to get 'the next string ptr' in addition. ... | |mov ebx eax;dw aligned strings are faster ... | Would it be enough to touch each 16th bytes in the 64K memory area ... Cache-line size is fixed, my AMD got 64 bytes per line. ...
    (alt.lang.asm)
  • Memory Question
    ... I have wrote a helper to my program which monitors object count, memory utilization and a threshold of 10% to determine how many objects are sticking around and how many are being garbage collected. ... occured right before the original String count). ... def print_threshold_breakers hsh1, hsh2, threshold ... putsf 'Building mem usage', mem_usage ...
    (comp.lang.ruby)
  • Re: Fast string operations
    ... worried about string performance. ... > is why people use unsafe code now and then to use pointer arithmetic to loop ... > I'm aware that looping has to occur one way or the other, but with Trim, ... The customer perceives this as a memory leak. ...
    (microsoft.public.dotnet.languages.csharp)