clr

Java vs .NET performance [closed]

坚强是说给别人听的谎言 提交于 2019-11-30 03:40:59
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . I got myself very surprised after I wrote this small code to compare .NET 4.5 and Java 8 performance in my computer: class ArrayTest { public int[][] jagged; public ArrayTest(int width, int height) { Height = height; Width = width; Random rng = new Random(); jagged = new int[width

Writing an Iron Python debugger

不问归期 提交于 2019-11-30 03:14:54
问题 As a learning exercise I'm writing myself a simple extension / plugin / macro framework using IronPython - I've gotten the basics working but I'd like to add some basic debugging support to make my script editor easier to work with. I've been hunting around on the internet a bit and I've found a couple of good resources on writing managed debuggers (including Mike Stall's excellent .Net Debugging blog and the MSDN documentaiton on the CLR Debugging API) - I understand that IronPython is

SQL Server: How to check if CLR is enabled?

泄露秘密 提交于 2019-11-30 02:32:45
SQL Server 2008 - What is an easy way to check if clr is enabled? Jason SELECT * FROM sys.configurations WHERE name = 'clr enabled' Check the config_value in the results of sp_configure You can enable CLR by running the following: sp_configure 'show advanced options', 1; GO RECONFIGURE; GO sp_configure 'clr enabled', 1; GO RECONFIGURE; GO MSDN Article on enabling CLR MSDN Article on sp_configure The accepted answer needs a little clarification. The row will be there if CLR is enabled or disabled. Value will be 1 if enabled, or 0 if disabled. I use this script to enable on a server, if the

Can a call to Assembly.Load(byte[]) raise the AppDomain.AssemblyResolve event?

此生再无相见时 提交于 2019-11-30 01:47:49
Suppose I have a handler for AppDomain.AssemblyResolve event, and in the handler I construct a byte array and invoke the method Assembly.Load(byte[]) . Can this method itself cause the AssemblyResolve event to be raised again, and cause my handler to be re-entered? My question is not restricted only to assemblies that can be generated using C# compiler, they can contain abritrary metadata and executable code supported by the CLR. I did some experiments and haven't find any cases when it happens. I tried to load assemblies that require additional references, tried to add CAS attributes to the

What does 'Cor' stand for?

僤鯓⒐⒋嵵緔 提交于 2019-11-30 01:43:48
I've seen in it in the primary CLR dll, mscorlib.dll, and I've seen in it in this CLR Profiling API interface, ICorProfilerCallback2. Just curious: what does the word 'Cor' stand for? "Common Object Runtime" For more, see: http://www.danielmoth.com/Blog/2005/05/mscorlibdll.html cor: Before .NET was chosen as the name, this new platform was a successor to COM so it was codenamed COM 3.0 and then the name chosen was… Common Object Runtime (cor) and that is where mscorlib derives its name from (and that stuck regardless of the fact that .NET was the final name)! EDIT: Here's an interesting

To GC.Collect or not?

[亡魂溺海] 提交于 2019-11-30 00:07:00
Reading this old but classic document Writing High-Performance Managed Applications - A Primer , I came across following statment The GC is self-tuning and will adjust itself according to applications memory requirements. In most cases programmatically invoking a GC will hinder that tuning. "Helping" the GC by calling GC.Collect will more than likely not improve your applications performance I am working with applications that during a given point in time, consumes a lot of memory. When I am done in code consuming that memory, I am calling GC.Collect. If I don't do it I get Out of memory

.NET process memory usage = 5x CLR Heap Memory?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 23:19:05
问题 I'm trying to tackle down some memory usage issues. Overall my application collects a few data values and visualizes them using a C1 WPF charts and datagrids finally putting everything into PDF reports. Profiling my process using YourKit I'm faced with the situation, that the CLR heap size is ~120MB (which is all fine) while the process memory size is ~580MB. This is nearly 5 times the memory consumption of my actual CLR heap size. My CLR peak size was 220MB vs. 710MB process memory

Potential pitfalls with static constructors in C#

邮差的信 提交于 2019-11-29 23:09:43
My question comes after refactoring a class that contained only static methods to be declared as a static class, and experiencing weird issues when starting the application. I have not performed any thorough investigation but it seems that some call being made from within the static constructor does not complete for some reason. So, I would like to know where there are any pitfalls when using static constructors in C#? More specifically, are there any things that should be avoided at all cost and not be used from within the static constructor? There are several pitfalls to static constructors.

Cast vs 'as' operator revisited

旧时模样 提交于 2019-11-29 23:07:17
I know there are several posts already concerning the difference between casts and the as operator. They all mostly restate the same facts: The as operator will not throw, but return null if the cast fails Consequently, the as operator only works with reference types The as operator will not use user-defined conversion operators Answers then tend to debate endlessly the how to use or not use the one or the other and the pros and cons of each, even their performance (which interests me not at all). But there is something more at work here. Consider: static void MyGenericMethod<T>(T foo) { var

Why does null exist in .NET?

你。 提交于 2019-11-29 22:54:16
Why can values be null in .NET? Is this superior to having a guarantee where everything would have a value and nothing call be null? Anyone knows what each of these methodologies are called? Either way, I am not very knowledgeable on this, but wouldn't having a value for everything makes things easier, in terms of simplicity, i.e. eliminating null checks, and being able to write more streamlined algorithms that doesn't have to branch out for checks. What are the pros and cons of each style in terms of performance, simplicity, parallellism, future-proofing, etc. As appealing as a world without