|
Depends - do you mean the startup time for .NET ( nothing you can do, really ), or your app ( it's kind of insane to ask that without showing us code )
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Thanks Christian
i mean startup time for .net apps (generally)
|
|
|
|
|
Adding to what others said, you can try using RuntimeHelpers.PrepareMethod to pre-JIT. This improves the load time. When a .NET application starts, you can always expect a small delay as CLR loads. In C++, you can use /DelayLoad:dllname[^] linker option to delay loading of a DLL. So it will be loaded the first time when it is used and this can improve the startup time. I am not sure the equivalent of this in C#.
|
|
|
|
|
1. Where would the call to PrepareMethod be? If it's in startup, it would slow things down even more.
2. MSDN[^] says that PrepareMethod "Prepares a method for inclusion in a Constrained Execution Region (CER) with the specified instantiation.". Nowhere does it mention that the method is JITted. AFAIK, CERs are created to make sure that certain code gets executed always in the face of errors, however critical they may be.
N a v a n e e t h wrote: In C++, you can use /DelayLoad:dllname[^] linker option to delay loading of a DLL.
That is how .NET works by default - assemblies are loaded only when a method referencing a type in an assembly is JITted does an assembly get loaded.
|
|
|
|
|
S. Senthil Kumar wrote: it would slow things down even more.
But I have an opposite experience. I can see slight changes when I used this.
2 - Yes, MSDN is not saying that methods are jitted. I got the idea from JIT methods at runtime[^] article. It worked well in my case.
S. Senthil Kumar wrote: assemblies are loaded only when a method referencing a type in an assembly is JITted does an assembly get loaded.
Yes. But the delay you are seeing is CLR loads not the assemblies you have used loading. We can even delay the loading of these assemblies. Read this[^].
|
|
|
|
|
N a v a n e e t h wrote:
But I have an opposite experience. I can see slight changes when I used this
I'm not convinced. I read the article you linked to and the author's response to your comment - he says he'll hide the initial delay by showing a splash screen. The author's idea is to take the JITting performance hit upfront rather than amortizing it over the running time of the application - there's still a performance hit. I haven't seen it in practice though.
N a v a n e e t h wrote: Yes. But the delay you are seeing is CLR loads not the assemblies you have used loading. We can even delay the loading of these assemblies. Read this[^].
Again, the article says this is useful if the startup code isn't doing pure unmanaged stuff. Only C++/CLI offers that ability, code compiled in all other languages will immediately require the CLR's services anway.
Interesting links though, thanks.
|
|
|
|
|
How fast is fast? You have to provide some metrics about what you have and what you're looking for.
only two letters away from being an asset
|
|
|
|
|
If I were you, I'd profile the application looking to see where the "slowdowns" actually are. You can ngen all you like, but if you're performing unnecessary work, this isn't going to help you in any way.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi,
I need to create a small program that removes duplicates of same picture, but by duplicate I mean that one picture can be a wallpaper and the other one a very small picture, both being "identical". Any ideas?
Thanks
modified on Monday, June 15, 2009 5:05 PM
|
|
|
|
|
Do you mean (Same Image AND Different Size) ? are Identical ?
I know nothing , I know nothing ...
|
|
|
|
|
Yes, same image in different sizes
|
|
|
|
|
identical as in tiger == cat ?
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Not sure what you mean by that. I mean that for example, you have an wallpaper size image whih was shrinked using some tool. Is it possible to compare them?
|
|
|
|
|
You will have to decide for yourself when you call two images identical.
Here is one possibility:
- shrink the larger one to the size of the smaller one;
- now you have to images of identical size; iterate over all pixels in both, calculate the pixel difference, and make a histogram of that deviation.
Pixel difference could be (red1-red2)^2 + (blue1-blue2)^2 + (green1-green2)^2 or something similar.
Then apply some criterium on the histogram to judge equality.
Drawbacks:
1. this will not be fast;
2. the shrink you apply may be somewhat different from the original shrink;
3. the algorithm will fail if one picture is a shrink of only a (large) part of the other
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
I always found my self , at the voting button every time I read an answer for you ...
please kindly accept respect.
Kind regards ....
I know nothing , I know nothing ...
|
|
|
|
|
Thanks for the kind words, not sure how they fit together with a 1-vote though.
[EDIT]That's better![/EDIT]
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
modified on Monday, June 15, 2009 6:11 PM
|
|
|
|
|
I thought Vote 1 = is Number 1 = 1st = The Top
any way I fixed that
I know nothing , I know nothing ...
|
|
|
|
|
the thumbs up/down icons may guide you in the right direction.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
I'm using Word automation to open a document that has some areas protected. I'm trying to figure out how to select the unprotected area of the document. How can this be done?
As a solution I recorded a macro inside Word that presses F8 five times which selects the unprotected section as I want. The marco code shows the following:
Selection.Extend
Selection.Extend
Selection.Extend
Selection.Extend
Selection.Extend
What is the syntex in C# if I wanted to use Selection.Extend?
|
|
|
|
|
|
That link does not give me enough information to solve my problem.
|
|
|
|
|
Ok, sorry, I guess I was wrong. I won't bother you any more.
|
|
|
|
|
dptalt wrote: That link does not give me enough information to solve my problem.
You probably read something about office automation, then it would.
|
|
|
|
|
Hi all,
I need a small tip on the following;
I have an assignment were I need to create a sort of a server on which I will have an application running (which application has to be created by myself). This application should be able to read the packets received on the server ethernet card, manipulate the packets (the actual bits) and output the modified packets on another ethernet card (or if possible the same card used as input).
I need some feedback if it is possible to create such an application, which will be able to perform such job, and if possible, how difficult it is to make (is there any ready to use dll files or classes that can perform parts of this job like for example reading and writing to/from the ethernet card?)
Hel from your side will be greatly appreciated.
regards
sandro
|
|
|
|
|
Your question has been sitting there for some time with no response.
There are several reasons for this.
1) You say this is an assignment. That makes it sound like homework but you have not indicated what, if any, research you have done. No one here is likely to do your homework for you.
2) The whole concept sounds highly suspicious. The sort of thing that a malicious program might do. I'm not suggesting that it is, but you do nothing to dispel that impression.
So do some research for yourself. Find something that you can adapt or copy and have a go. When you get problems with a specific part of your code, please come back, with code snippets, details of any errors (including precise error messages) or behavioural problems.
Good Luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|