Tuesday, November 29, 2016
Basic network data capture using Wireshark
Thursday, September 22, 2016
Avoid Boxing & Unboxing to improve performance
- Boxed value type objects take up more memory
- Boxed value type objects require an additional read
- Short-lived value type objects eat up Gen 0 heap & this forces frequent garbage collections
- Boxing and unboxing operations consume CPU & time
- Casting is required & it can be costly
- Use ToString method of numeric data types such as int, double, float etc.
- Use for loop to enumerate on value type arrays or lists (do not use foreach loop or LINQ queries)
- Use for loop to enumerate on characters of string (do not use foreach loop or LINQ queries)
- If you define your own value type then override implementation of basic object methods.
- Don’t assign value type instance to object unless unavoidable
- Use generic List<>, Dictionary<> (et al) instead of ArrList & HashTable.
- Use Nullable<> value types (examples int?, float? etc)
- When using string.Format (SrtingBuilder.AppendFormat) or similar API's that use 'params object[]' pass on value type objects by calling 'ToString()' method
- Implicit boxing (Example: object num = 1; )
- Use of foreach on value types
- LINQ queries on value type collections
- Casting to value types
Friday, September 9, 2016
Using StringBuilder for Performance
- Always try to instantiate StringBuilder with some default value or capacity
- Use in large loops or at places where most of the concatenations are happening
- Use the same instance of StringBuilder in all methods that construct a single string
Wednesday, July 20, 2016
Avoid debug builds
I think debug builds should be avoided, and here is my view on this.
There could be below potential benefits of giving away debug builds –
1. Improved overall build time duration
2. Issue resolution & debugging is required only for release builds
3. Developers can concentrate on verifying/working on actual deliverable release bits instead of non-deliverable debug builds
About Debug builds –
1. Debug builds are generally not smoke tested
2. Binaries that have debug specific code, anyway cannot be tested for product being shipped
3. For .NET components, it is easy to debug release binaries (and generally we must avoid writing debug specific code)
4. Generally we require debugging on dev machine, so we can manually compile with debug setting and then debug (and in many cases usually trace is sufficient)
5. If needed, it is easily possible to generate debug binary for detailed debugging purpose
Friday, April 25, 2008
About Life
Who can understand rules, is able to play
Life is what, nothing but a stock market
Who can bet, gets all the wealth
Life is what, nothing but a temptation, Needs lot of determination
If you have the motivation, you can alter any situation
Life is what, nothing but a teacher
First try to learn, then you can earn
Life is what, nothing but a cake
Who can share, will get the fame
Life is what, nothing but a joy
Who can extract, can learn to fly
Life gives what, nothing but pain
But don’t you cry, just always try
The reward you will get gives all the joy
Life needs what, a goal to achieve
Who can set, enjoy up to the best
Life is what, a puzzle to be solved
Who can solve, please ask to almighty GOD
Love and betrayals are part of Life
When things aren’t right, situation is tight,
You need to fight, only then you can survive
Ultimately Life is a mystery; know one knows its history
If you understand its chemistry, please tell me immediately :)
- Vaibhav M. Gawali
