Software slug

Software slug

A Software slug (or just "slug", short for "slowness bug") is a Software bug that only makes a program slow, but not incorrect. Programs as first written generally contain both bugs and slugs. Bugs are usually removed during program testing, while slugs are usually not, unless performance analysis is employed during development. Slugs can sometimes increase execution time by one or more orders of magnitude.

There are different kinds of slugs. Generally, things that could be done intentionally to make a program run longer can also occur unintentionally. One commonly accepted kind of slug is a hot spot, which is a tight inner loop where the program counter spends much of its time. For example, if one often finds at the bottom of the call stack a linear search algorithm instead of binary search, this would be a true hot spot slug. However, if another function is called in the search loop, such as string compare, then the string compare function would be found at the bottom of the stack, and the call to it in the loop would be at the next level up. In this case, the loop would still be a slug, but it would not be a hot spot. In all but the smallest programs, hot spot slugs are rare, but slugs are quite common.

Data structures that are too general for the problem at hand might also impair performance. For example, if a collection of objects remains small, a simple array with linear search could be much faster than something like a "dictionary" class, complete with hash coding. With this kind of slug, the program counter is most often found in "housekeeping" such as dynamic memory allocation/de-allocation as these collections are being constructed and then 'destructed'.

Another common motif is that a powerful function is written to collect a set of useful information (from a database, for example). Then that function is called multiple times, rather than taking the trouble to save the results from a prior call. A possible explanation for this could be that it is beyond a programmer's comprehension that a function call might take a million times as long to execute as an adjacent assignment statement. A contributing factor could be information hiding, in which external users of a module can be ignorant of what goes on inside it.

References

* Dunlavey, “Performance tuning with instruction-level cost derived from call-stack sampling”, ACM SIGPLAN Notices 42, 8 (August, 2007), pp. 4-8.
* Dunlavey, “Performance Tuning: Slugging It Out!”, Dr. Dobb's Journal, Vol 18, #12, November 1993, pp 18-26.


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Anexo:Grupos de Usuarios de Software Libre de Argentina — Este artículo contiene información sobre Grupos de Usuarios de Software Libre y organizaciones nucleados en Usuarios de Software Libre Argentina. Contenido 1 Asociaciones 1.1 Asociación Civil Gleducar 1.2 Asociación Civil Software Libre Argentina …   Wikipedia Español

  • Surreal Software — Infobox Company company name=Surreal Software company type=Public (Subsidiary of Midway Games) company foundation=Seattle, Washington, USA (1995) location=Chicago, Illinois key people=Alan Patmore, Co Founder and Studio Head Stuart Denman, Co… …   Wikipedia

  • Messiah (software) — Messiah Developer(s) pmG Worldwide, LLC Stable release 4.0 / 16 April 2009 Operating system Windows (2000, XP 32bit/64bit or Vista 32bit/64bit) Type 3D computer graphics …   Wikipedia

  • Big Red Software — was a computer game developer set up in the UK in 1988 by Paul Ranson . It was bought out by, and merged with, Eidos Plc in 1995 along with Simis and Domark forming Eidos Interactive.In 1997, Paul Ranson resigned and the company changed its name… …   Wikipedia

  • Performance analysis — In software engineering, performance analysis, more commonly today known as profiling, is the investigation of a program s behavior using information gathered as the program executes (i.e. it is a form of dynamic program analysis, as opposed to… …   Wikipedia

  • Deep sampling — is a variation of statistical sampling in which precision is sacrificed for insight. Small numbers of samples are taken, with each sample containing much information. The samples are taken approximately uniformly over the resource of interest,… …   Wikipedia

  • Liste chronologique des run and gun — La liste chronologique des run and gun répertorie les run and gun. La date indiquée correspond à la première sortie du jeu, toutes régions et plates formes confondues. Sommaire: 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992… …   Wikipédia en Français

  • Symbolics — is a privately held company that acquired the assets of the now defunct computer manufacturer Symbolics, Inc. and continues to sell and maintain the Open Genera Lisp system and the Macsyma computer algebra system. History Symbolics, Inc. [… …   Wikipedia

  • List of Virtual Console games (North America) — Contents 1 Available titles 1.1 Nintendo Entertainment System 1.2 Super Nintendo Entertainment System 1.3 Nintendo 64 …   Wikipedia

  • Liste de jeux PlayStation Portable —   Liste des listes de jeux vidéo  La liste de jeux PlayStation Portable répertorie alphabétiquement les jeux vidéo disponibles sur support UMD pour la console …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”