Currently browsing tag

performance

StringConcat

String Vs StringBuilder

Most of the people use string everywhere in their code. Actually when doing string concatenation, do you know what exactly you are doing? It has a big drawback mainly in concatenation which can be overcome by StringBuilder. It will give a vast improvement in performance when you use concatenation of …

generics2

C# – Generics

Generics allow you to delay the specification of the data type of programming elements in a class or a method, until it is actually used in the program. In other words, generics allow you to write a class or method that can work with any data type. You write the …

Function in WHERE clause

Function in WHERE clause

  Introduction When we are using the function in the SELECT statement it returns data depends on the number of records retrieve by the select statement and what type of value is passed in the scalar function. The performance of the MS SQL Query is little bit degraded using the …

php

Building PHP extensions with C++ the easy way

Here is an easy way to build a PHP extension with C++ and default PHP packages on a Ubuntu system. I use SWIG to wrap C++ code to the Zend API. When using loops and recursion intensively, porting a few functions to C++ can give you some extra power. First, …

Performance

INNER or LEFT JOIN for Performance

INNER or LEFT JOIN for Performance In this article I am trying to discuss a very common scenario that between INNER JOIN and LET JOIN which one is increase the performance and also discuss how to boost the join performance. First look at the definition of both INNER and LEFT …

IN EXISTS clause and their performance

“IN”, “EXISTS” clause and their performance Introduction To improve the performance of the Query, the general guideline is not to prefer the “IN” Clause. The guideline of the MS SQL query performance says that if we needs “IN” clause, instead of using “IN” clause we must use the “EXISTS” clause. …

Improve the performance by Execution Plan

Improve the performance by Execution Plan Introduction Developers ask a common quest “How to improve the performance of a SQL Query”. It is not so easy to answer as lot of factors is related to it. There are some general guidelines that we can follow to improve the overall performance …

Runtime vs memory usage

Runtime vs. memory usage pre { background-color:#444; white-space:pre-wrap; font-size:80%; padding:0px 6px; } Oftentimes, better runtime can result in higher memory usage. Here is an example to create some strings to test bulk inserts on Redis: $cmd = “”;$start = microtime(true);for ($i=0; $i

Inserted Scanning Performance

Inserted Scanning Performance Introduction Here there is an interesting case scenario mentioned bellow. We’re pulling values from an “inserted” table that is created in aninsert trigger. When we do an insert and view the execution plan inQuery Analyzer, the “Inserted Scan” accounts for 98% of the entirequery cost So, in …

PHP Framework Comparison

PHP Framework Comparison Reading about PHP frameworks, you’ll get a lot about Symfony and Zend Framework. It is true that these frameworks have a lot of features and do great marketing. But what about performance and scalability? There are 2 kinds of frameworks: those written in C as an extension …

Members set get ArrayAccess and Iterator

Members, __set, __get, ArrayAccess and Iterator pre { background-color:#444; white-space:pre-wrap; font-size:85%; padding:0px 6px; } Lessons learned: __set() is 5 times slower than setting a member __get() + __set() is 13 times slower than incrementing a member Iterator is 4 times slower than using a member ArrayAccess is 3 times slower …

How to implement a real life benchmark with PHP

How to implement a real life benchmark with PHP pre { background-color:#444; white-space:pre-wrap; font-size:80%; padding:0px 6px; } To determine the maximum capacity of a web page, Apache ab is often used in the first step. Fetching one URL very often is optimal for caching and gives a best case. To …