Project details
Our customer, a worldwide leader in VoIP communication, needed to improve performance of their tool -
phone number recognizer (PNR).
Softage consultants successfully approached the problem. The first phase of the project was to perform an
analysis of the existing code and prepare detailed report on the results. The challenge was to identify and
locate bottlenecks and problems in the code impacting the tool performance and stability.
After completion of the analysis, the customer asked us to refactor the code.
Mains tasks of code refactoring were:
 | Increasing application performance and stability. Increasing amount of numbers found and quality of recognition (better phone number attributes recognition — land line, fax, mobile number). |  | Code porting to Mac OS X and Linux |
Additional requirements:
 | Size of compiled code should not significantly increase. |  | Quality of search should be high. At least same quantity of numbers found required and no additional recognition errors introduced. |
Softage consultants developed a project plan for code refactoring and completed the project to the customer
satisfaction.
As a result, new version of the PNR tool performs 12 times better than the previous one:
 | The tool find more telephone numbers |  | The tool works faster |  | Code size is reduced |  | The tool became cross-platform (Windows, Mac OS X, Linux) |
|
 |
Project details
Performance improvement
We used several ways to increase performance of the PNR tool, here are some examples:
 | Removed excessive copying of objects Where possible constant references are used instead of making object copy, in most cases copy
constructors and assignment operators were made private to avoid unexpected object copy. |  | Avoid double calculation of same value Where possible store pre-calculated value in temporary variable or private class member to avoid calculating it several times. Most common examples here are loop border condition and constant array sizes. |  | Algorithmic optimization Some linear searches were replaced with binary searches on ordered arrays or on tree-like structures |
Stability improvement
To improve application stability the following things were done:
 | Exception handling All external interface function implementations were enclosed by try-catch blocks to avoid any internal exceptions to go out from PNR code. |  | Control and minimize dynamic memory usage Where it is possible dynamic memory usage was removed. Where its usage is required then more effortswere done to control dynamic memory better and avoid leaks. |  | Object life-time control Every object now has an owner and controlled lifetime. When object can be used in many places and it is impossible to have single owner, reference counters are used to control object lifetime. |  | "Black-box" concept In PNR implementation, all class members made private allowing only operations via class methods to disallow all "unwanted" class member changes from other parts of PNR. |  | Synchronization Thread synchronizations were added to avoid changing objects from several threads at the same time. |
Testimoinal
«Softage has proven themselves a professional development partner that I feel confident in working
with. During the year I have been working with them they have delivered projects on time and with
good results. In addition to that, they have been communicative and reliable, qualities which we
deem essential in our daily work.
I am happy to recommend Softage and look forward to working with them in the future!»
Peter Kalmstrom, Program Manager Skype Toolbars
|