Types of JIT
Types of JIT
of Computing
WEB DEVELOPMENT
&
22CAH-301/22SCH-301
Career
Web Development
Planning 1
Topics to be Covered
2
Types of JIT Compilers
• Just-In-Time (JIT) compilation is a technique used to improve the performance of interpreted languages by compiling code at runtime, rather than
before execution. This approach can optimize the code based on actual usage patterns. There are different types of JIT compilers, each with its own
strengths and strategies. Here are the main types:
1. Pre-JIT (Eager JIT)
• Definition: Compiles all the code in a program to native machine code before execution begins.
• Characteristics:
• Typically used in scenarios where the overhead of JIT compilation during execution is unacceptable.
• Can lead to longer startup times due to the need to compile everything upfront.
• Once compilation is done, execution can proceed at full speed without further JIT-related delays.
• Example Use Case: Applications that require maximum performance immediately after startup, such as high-frequency trading systems.
2. Normal-JIT (Standard JIT)
• Definition: Compiles code as it is needed during execution. This is the most common form of JIT.
• Characteristics:
• Compiles methods or code blocks the first time they are called.
• The compiled code is then cached and reused in subsequent calls, reducing overhead over time.
• Balances the initial compilation cost with ongoing performance improvements.
• Example Use Case: General-purpose applications where a balance between startup time and runtime performance is desired, such as web
applications.
3
CONTINUE…….
3. Economy-JIT
• Definition: A variant of JIT that prioritizes minimizing the runtime compilation overhead, often at the cost of some runtime
performance.
• Characteristics:
• Compiles code less aggressively than Normal-JIT.
• May focus on compiling only the most frequently used parts of the code.
• Suitable for environments with constrained resources or where the overhead of JIT compilation needs to be kept very low.
• Example Use Case: Embedded systems or applications running on devices with limited computational power.
4. Tiered JIT
• Definition: Combines different levels of JIT compilation to optimize both startup performance and long-term execution speed.
• Characteristics:
• Starts with a quick, low-optimization compilation to get the code running fast.
• Continues to recompile frequently executed code with higher optimization levels as the program runs.
• Provides a balance between fast startup and high peak performance.
• Example Use Case: Modern Java Virtual Machine (JVM) implementations, such as the HotSpot JVM, which uses tiered compilation
to optimize Java applications.
4
COMPARISON :
Runtime Compilation
JIT Type Startup Time Performance Strategy
Compile everything
Pre-JIT Long High
before execution
5
Security Manager. VS.NET and C
• Security Manager:
• The central component that enforces security policies and ensures that the code adheres to
security requirements.
• It manages permissions and decides whether specific operations are allowed based on the
security policy.
• VS.NET (Visual Studio .NET):
• An integrated development environment (IDE) from Microsoft used for developing applications
in .NET.
• Provides tools and features to facilitate the development, debugging, and deployment of secure
applications.
• C#:
• A programming language developed by Microsoft that runs on the .NET framework.
• C# is used to develop a variety of secure applications, from web applications to services and
desktop applications.
6
Introduction to Project and
Solution in Studio:
• Solution File (.sln):
• The solution file, with a .sln extension, contains metadata about the projects within the solution and their configurations.
• It keeps track of the projects included in the solution, the build order, and other global settings.
• Management:
• Solutions can manage dependencies between projects, making it easier to build and debug large applications with multiple
components.
• They provide a way to configure solution-wide settings, such as build configurations (Debug/Release), platform targets, and version
control.
•
Project File (.csproj, .vbproj, etc.):
• The project file, with extensions like .csproj for C# or .vbproj for Visual Basic, defines the files included in the project, references to
other projects or libraries, and build settings.
• It specifies how the project should be compiled, packaged, and deployed.
• Contents:
• A project typically includes source code files (e.g., .cs files for C#), resource files, configuration files, and references to external
libraries (NuGet packages).
• It organizes these files into folders and subfolders to maintain a clean structure.
7
Command Line Argument
• Command Line Arguments: Overview
• Definition: Command line arguments are parameters passed to a program at the time of its execution
through the command line interface (CLI). They are used to control the behavior of the program or script.
• Script Execution:
• Build Scripts: Tools like npm, yarn, and gulp often use command line arguments to specify tasks,
configurations, or environments.
• Deployment Scripts: Scripts for deploying applications to different environments (e.g., staging,
production) often take arguments to specify the target environment or version.
• Framework and Tooling Commands:
• React: create-react-app my-app where my-app is a command line argument specifying the project name.
• Angular: ng generate component my-component where my-component is an argument specifying the
name of the component to generate.
8
Boxing and Unboxing
Boxing:-
• Definition: Boxing is the process of converting a value type (such as an integer or a struct) to a reference
type (such as an object). This involves creating a new object on the heap and copying the value into this
object.
• Example:
• int value = 123; // Value type
• object boxedValue = value; // Boxing: converting int to object
Unboxing:-
• Definition: Unboxing is the process of converting a reference type back to a value type. It involves
extracting the value from the object.
• Example:
• object boxedValue = 123; // Boxing: converting int to object
• int unboxedValue = (int)boxedValue; // Unboxing: converting object back to int
9
Pass by value and by reference and
out parameter:
• Pass by Value: The function receives a copy of the variable’s value. Changes to the
parameter do not affect the original variable.
• Pass by Reference: The function receives a reference to the variable. Changes to the
parameter affect the original variable.
• Out Parameter: Similar to pass by reference, but specifically used for returning
multiple values from a function in languages like C#. The caller does not need to
initialize the variables before the function call.
10
What is an Array List?
• An array list is a dynamic array that can grow and shrink in size. Unlike a fixed-size
array, an array list can dynamically adjust its capacity as elements are added or
removed.
• Array lists are a core data structure in web development, enabling developers to
efficiently manage collections of data both on the client-side and server-side. In
JavaScript, they are used for a wide range of tasks including DOM manipulation,
event handling, and data processing. On the server side with Node.js, array lists help
manage and process data from HTTP requests, maintain state, and respond to clients.
11
Hash Table:
• What is a Hash Table?
• A hash table (or hash map) is a data structure that maps keys to values. It uses a hash
function to compute an index into an array of buckets or slots, from which the desired
value can be found.
• Key Concepts
• Hash Function: A function that converts a given key into an integer (hash code),
which is then mapped to an index in an array.
• Collision: When two keys hash to the same index. This is typically handled using
techniques like chaining (linked lists) or open addressing (finding another empty slot).
• Load Factor: The ratio of the number of elements to the number of buckets. A higher
load factor can lead to more collisions.
12
REFERENCES
13
Generic collections
• Generic collections are data structures in programming languages that allow you to store and
manipulate collections of items of the same type, while providing type safety and flexibility.
They're called "generic" because they can work with any data type, rather than being tied to a
specific type like integers or strings.
• List: An ordered collection of items, where items can be accessed by index. Lists typically
allow duplicates and maintain the order of insertion.
• Set: A collection of unique items with no duplicates. Sets do not maintain any specific order.
• Map / Dictionary / Hashtable: A collection of key-value pairs where each key is unique.
Maps allow you to retrieve values based on their corresponding keys.
• Queue: A collection that follows the FIFO (First-In-First-Out) principle. Items are added to the
end of the queue and removed from the front.
• Stack: A collection that follows the LIFO (Last-In-First-Out) principle. Items are added and
removed from the top of the stack.
14
THANK YOU