Just in Time (JIT) and its types

Nov 18, 2010 Posted by Lara Kannan 0 comments

Just in Time (JIT)

JIT is responsible for converting the managed code into machine code. It is a part of the runtime execution environment.

JIT known as dynamic translation is a technique for improving the runtime performance of a computer program.


JIT builds upon two earlier ideas in run-time environments:

  • Byte code compilation
  • Dynamic compilation.

It converts code at runtime prior to executing it natively, for example byte code into native machine code.

The performance improvement over interpreters originates from caching the results of translating blocks of code, and not simply reevaluating each line or operand each time it is met.

It also has advantages over statically compiling the code at development time, as it can recompile the code if this is found to be advantageous, and may be able to enforce security guarantees.

Thus JIT can combine some of the advantages of interpretation and static compilation.

Several modern runtime environments, such as Microsoft's .NET Framework and most implementations of Java and most recently Action script 3, rely on JIT compilation for high-speed code execution

JIT are of three types :

  1. Pre JIT
  2. Econo JIT
  3. Normal JIT

1. Pre JIT : Compiles entire code into native code at one stretch

  1. It converts all the code in executable code
  2. it is slow
  3. It compiles complete source code into native code in a single compilation cycle.
  4. This is done at the time of deployment of the application.

2. Econo JIT : Compiles code part by part freeing when required

  1. It will convert the called executable code only.
  2. it will convert code every time when a code is called again.
  3. It compiles only those methods that are called at runtime.
  4. these compiled methods are removed when they are not required.
  5. This compiler converts the MSIL code into native code without any optimizations

3. Normal JIT Compiles only that part of code when called and places in cache

  1. It will only convert the called code
  2. It will store in cache so that it will not require converting code again.
  3. Normal JIT is fast.
  4. Compiles only those methods that are called at runtime.
  5. These methods are compiled the first time they are called, and then they are stored in cache.
  6. When the same methods are called again, the compiled code from cache is used for execution.


Share
Labels: ,

WCF Binding Comparison

Oct 29, 2010 Posted by Lara Kannan 0 comments
WCF Binding Comparison

In my ongoing quest to produce the simplest table possible summarizing the key differences between the various Windows Communication Foundation (WCF) built-in bindings, I came up with the following:









Binding Class Name TransportMessage EncodingMessage VersionSecurity Mode
BasicHttpBindingHTTPTextSOAP 1.1None
WSHttpBindingHTTPTextSOAP 1.2 & WS-A 1.0Message
WSDualHttpBindingHTTPTextSOAP 1.2 & WS-A 1.0Message
WSFederationHttpBindingHTTPTextSOAP 1.2 & WS-A 1.0Message
NetTcpBindingTCPBinarySOAP 1.2Transport
NetPeerTcpBindingP2PBinarySOAP 1.2Transport
NetNamedPipesBindingNamed PipesBinarySOAP 1.2Transport
NetMsmqBindingMSMQBinarySOAP 1.2Message
MsmqIntegrationBindingMSMQX**Not SupportedTransport


Share

Types of Services in WCF

Posted by Lara Kannan 2 comments

There are three types of services in WCF, and they are the following:
  • Typed
  • Untyped
  • Typed message
Typed Service

A typed service is the simplest of services, and is very similar to the methods in a class, in that both the parameters and method return values can be both simple or complex data types.

A typed service can also return a value or return a modified parameter value. The following example illustrates a typed service in which typed operations are used:

[ServiceContract(SessionMode = SessionMode.Required)]
public interface IBookOrder
{

[OperationContract]
void PlaceOrder(string title, decimal cost);

}

This next example shows the use of the ref parameter to return a modified parameter value:

[ServiceContract(SessionMode = SessionMode.Required)]
public interface IBookOrder
{

[OperationContract]
void PlaceOrder(string title, decimal cost, ref ordernumber);

}

Data contracts provide the ability to extend this functionality and accept complex data types as parameters or returned results.

Typed Message Service

A typed message service accepts and returns message information via custom classes that are defined by message contracts. With a typed message service the operation accepts a custom message parameter in the form of a message class, and the responsibility of deciphering the message falls upon the service operation.

The following example shows a service contract along with a defined typed message that is used as a parameter in a typed service operation:

[ServiceContract]
public interface IBookOrder
{

[OperationContract]
void PlaceOrder(Contract MyContract);

}

[MessageContract]
public class MyContract
{

[MessageHeader]
string Title;

[MessageBodyMember]
decimal cost;

}

Untyped Service

Untyped services let you do your work at message level, so this is the most complex of the service types. At this level the service operation accepts and returns message objects so it is recommended that you use this type of service only when you need this level of control, that is, working directly with the message.

The following example shows an operation contract passing a message object as an untyped service operation:

[ServiceContract(SessionMode = SessionMode.Required)]
public interface IBookOrder
{

[OperationContract]
void PlaceOrder(message IncomingMessage);

}

Thanks : codesubmit.com

Share