Skype Phone Number Recognizer refactoring. Best Practices of Russian offshore IT outsourcing companies. RUSSOFT
Attention: the new version of RUSSOFT website is available at russoft.org/en.
RUS | ENG

Supported by:

Project Title: Skype Phone Number Recognizer refactoring

Company:SoftAge View Company Profile
Client (Country):Luxembourg, Skype
Duration, months:36
Total Effort, person/months:150
Total Views:3376

The Challenge

Our customer - Skype, 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 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 to refactor the code.

Mains tasks of code refactoring were:
  1. Increasing application performance and stability. Increasing amount of numbers found and quality of recognition (better phone number attributes recognition – land line, fax, mobile number).
  2. Code porting to Mac OS X and Linux

    Additional requirements:

  3. 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.

The Solution

Performance improvement

We used several ways to increase performance of the PNR tool, here are some examples:
  1. 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.

  2. 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.

  3. 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:
  1. Exception handling
    All external interface function implementations were enclosed by try-catch blocks to avoid any internal exceptions to go out from PNR code.

  2. Control and minimize dynamic memory usage
    Where it is possible dynamic memory usage was removed. Where its usage is required then more efforts were done to control dynamic memory better and avoid leaks.

  3. 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.

  4. "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.

  5. Synchronization
    Thread synchronizations were added to avoid changing objects from several threads at the same time.

Tools and Technologies

MS Visual Studio, 2008, WiX, Python, STL, Boost, COM/ActiveX, POCO, XUL, WTL, XML.

Related links

Project description on Softage website:
http://www.softage.ru/projects/skype-code-refactoring/
Skype website: http://www.skype.com/intl/en/home

Post Your Story, Tell All About Your Success!

If you want the story of your company to appear on the portal please fill out this form and send it to [email protected]. We would also like you to leave contact information (name, e-mail, phone) of a person who is responsible for filling the form to clarify any questions, which could appear.

Available Success Stories From Companies:

Disclaimer

All information contained in this Section is owned by RUSSOFT.org and its Participants and is protected by Russian and international copyright laws. Any reproduction or republication of all or part of this Section has to remain intact and include a notice on the copyright of RUSSOFT.org or the Participants, as applicable.

While the information of this Section has been presented with all due care, RUSSOFT.org does not warrant the accuracy, completeness, usefulness and truth of Section’s information, links and logos derived from third parties. RUSSOFT.org is not liable for any loss or damage occurring from the use of this Section’s materials.