
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
Optimization Tips for C# Code
The following are the tips −
Prefer List
Use List whenever necessary. Working with ArrayList for the same work can make the working of code slower. This is specially if you are storing multiple types of objects within the same list.
Use multiplication-shift operation
Prefer multiplication-shift operation instead of division operator, since the usage of division operator slows the code.
Less code takes less memory
Try to get work done using operator to concise the code and make it work in a single line.
Use operators like && that would allow you to mention all the conditions in a single line.
- Related Articles
- Optimization Tips for Python Code?
- 6 JavaScript Optimization Tips from Google
- Unit Testing for C# Code
- Title Tag Optimization Guide for Google
- Organic Search Traffic for SEO Optimization Metric
- How to Use YouTube Analytics for Video Optimization?
- Conversion Rate Optimization (CRO) Report for E-commerce
- The Importance Of Technical SEO For Mobile Optimization
- C++ code for calculation of a physics experiment
- C++ code to check query for 0 sum
- Keyword Optimization: How to Optimize for the Top Search
- The Importance of Technical SEO for Social Media Optimization
- Get the hash code for this instance in C#
- Tips for securing online shopping
- Beginner Tips for Learning Python

Advertisements