|
Packit |
1470ea |
# German translation for gnome-devel-docs (accessibility handbook).
|
|
Packit |
1470ea |
# Copyright (C) 2009 gnome-devel-docs's COPYRIGHT HOLDER
|
|
Packit |
1470ea |
# This file is distributed under the same license as the gnome-devel-docs package.
|
|
Packit |
1470ea |
# Mario Blättermann <mario.blaettermann@gmail.com>, 2009-2010, 2012-2013, 2015.
|
|
Packit |
1470ea |
# Christian Kirbach <Christian.Kirbach@googlemail.com>, 2010.
|
|
Packit |
1470ea |
#
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Project-Id-Version: gnome-devel-docs master\n"
|
|
Packit |
1470ea |
"POT-Creation-Date: 2015-12-30 08:54+0000\n"
|
|
Packit |
1470ea |
"PO-Revision-Date: 2015-12-30 10:53+0100\n"
|
|
Packit |
1470ea |
"Last-Translator: Mario Blättermann <mario.blaettermann@gmail.com>\n"
|
|
Packit |
1470ea |
"Language-Team: Deutsch <gnome-de@gnome.org>\n"
|
|
Packit |
1470ea |
"Language: de_DE\n"
|
|
Packit |
1470ea |
"MIME-Version: 1.0\n"
|
|
Packit |
1470ea |
"Content-Type: text/plain; charset=UTF-8\n"
|
|
Packit |
1470ea |
"Content-Transfer-Encoding: 8bit\n"
|
|
Packit |
1470ea |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
Packit |
1470ea |
"X-Poedit-SourceCharset: utf-8\n"
|
|
Packit |
1470ea |
"X-Generator: Poedit 1.8.5\n"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. Put one translator per line, in the form NAME <EMAIL>, YEAR1, YEAR2
|
|
Packit |
1470ea |
msgctxt "_"
|
|
Packit |
1470ea |
msgid "translator-credits"
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Mario Blättermann <mario.blaettermann@gmail.com>, 2009, 2012, 2013, 2015\n"
|
|
Packit |
1470ea |
"Christian Kirbach <christian.kirbach@googlemail.com>, 2010"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: page/title
|
|
Packit |
1470ea |
#: C/harmful.page:7
|
|
Packit |
1470ea |
msgid "Disk Seeks Considered Harmful"
|
|
Packit |
1470ea |
msgstr "Laufwerkszugriffe werden als nachteilig angesehen"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: page/p
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/harmful.page:8 C/index.page:54
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Disk seeks are one of the most expensive operations you can possibly perform. "
|
|
Packit |
1470ea |
"You might not know this from looking at how many of them we perform, but trust "
|
|
Packit |
1470ea |
"me, they are. Consequently, please refrain from the following suboptimal "
|
|
Packit |
1470ea |
"behavior:"
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Laufwerkszugriffe sind die wohl aufwändigsten Vorgänge, die Sie überhaupt "
|
|
Packit |
1470ea |
"ausführen können. Sie wissen das womöglich nicht aufgrund der Anzahl der "
|
|
Packit |
1470ea |
"Ausführungen, aber glauben Sie mir, dass sie es sind. Folglich vermeiden Sie "
|
|
Packit |
1470ea |
"bitte das folgende ungünstige Verhalten:"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/harmful.page:13
|
|
Packit |
1470ea |
msgid "Placing lots of small files all over the disk."
|
|
Packit |
1470ea |
msgstr "Viele kleine Dateien auf dem gesamten Laufwerk verteilen."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/harmful.page:18
|
|
Packit |
1470ea |
msgid "Opening, stating, and reading lots of files all over the disk"
|
|
Packit |
1470ea |
msgstr "Öffnen, stat() ausführen und lesen vieler Dateien vom gesamten Laufwerk"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/harmful.page:23
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Doing the above on files that are laid out at different times, so as to ensure "
|
|
Packit |
1470ea |
"that they are fragmented and cause even more seeking."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Obiges mit Dateien tun, die zu verschiedenen Zeitpunkten erstellt wurden, so "
|
|
Packit |
1470ea |
"dass sie fragmentiert sind und noch mehr Plattenaktivität verursachen."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/harmful.page:28
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Doing the above on files that are in different directories, so as to ensure "
|
|
Packit |
1470ea |
"that they are in different cylinder groups and cause even more seeking."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Obiges mit Dateien tun, die sich in verschiedenen Ordnern befinden, so dass auf "
|
|
Packit |
1470ea |
"verschiedene Zylindergruppen zugegriffen wird und so noch mehr Plattenaktivität "
|
|
Packit |
1470ea |
"verursacht wird."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/harmful.page:33
|
|
Packit |
1470ea |
msgid "Repeatedly doing the above when it only needs to be done once."
|
|
Packit |
1470ea |
msgstr "Wiederholt obiges tun, obwohl es nur einmal getan werden muss."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: page/p
|
|
Packit |
1470ea |
#: C/harmful.page:38
|
|
Packit |
1470ea |
msgid "Ways in which you can optimize your code to be seek-friendly:"
|
|
Packit |
1470ea |
msgstr "Mögliche Wege, wie Sie Ihren Code suchfreundlich optimieren können:"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/harmful.page:43
|
|
Packit |
1470ea |
msgid "Consolidate data into a single file."
|
|
Packit |
1470ea |
msgstr "Fassen Sie Daten in einer einzigen Datei zusammen."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/harmful.page:48
|
|
Packit |
1470ea |
msgid "Keep data together in the same directory."
|
|
Packit |
1470ea |
msgstr "Halten Sie Daten im gleichen Ordner vor."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/harmful.page:53
|
|
Packit |
1470ea |
msgid "Cache data so as to not need to reread constantly."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Speichern Sie Daten zwischen, so dass sie nicht fortwährend erneut eingelesen "
|
|
Packit |
1470ea |
"werden müssen."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/harmful.page:58
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Share data so as not to have to reread it from disk when each application loads."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Geben Sie Daten frei, so dass sie nicht beim Laden von Anwendungen immer wieder "
|
|
Packit |
1470ea |
"erneut gelesen werden müssen."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/harmful.page:63
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Consider caching all of the data in a single binary file that is properly "
|
|
Packit |
1470ea |
"aligned and can be mmaped."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Erwägen Sie, alle Daten in einer einzigen Binärdatei zwischenzuspeichern, die "
|
|
Packit |
1470ea |
"sauber aufgebaut ist und mit mmap verarbeitbar ist."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: page/p
|
|
Packit |
1470ea |
#: C/harmful.page:68
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"The trouble with disk seeks are compounded for reads, which is unfortunately "
|
|
Packit |
1470ea |
"what we are doing. Remember, reads are generally synchronous while writes are "
|
|
Packit |
1470ea |
"asynchronous. This only compounds the problem, serializing each read, and "
|
|
Packit |
1470ea |
"contributing to program latency."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Die Probleme mit Plattenzugriffen verstärken sich beim Lesen, was wir leider "
|
|
Packit |
1470ea |
"eben gerade tun. Merken Sie sich, dass im Allgemeinen Lesen synchron und "
|
|
Packit |
1470ea |
"Schreiben asynchron verläuft. Das verschlimmert nur das Problem mit jedem "
|
|
Packit |
1470ea |
"seriellen Lesevorgang und trägt zu Programmverzögerungen bei."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: license/p
|
|
Packit |
1470ea |
#: C/index.page:7
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Permission is granted to copy, distribute and/or modify this document under the "
|
|
Packit |
1470ea |
"terms of the GNU Free Documentation License, Version 1.1 or any later version "
|
|
Packit |
1470ea |
"published by the Free Software Foundation with no Invariant Sections, no Front-"
|
|
Packit |
1470ea |
"Cover Texts, and no Back-Cover Texts. You may obtain a copy of the GNU Free "
|
|
Packit |
1470ea |
"Documentation License from the Free Software Foundation by visiting
|
|
Packit |
1470ea |
"\"http://www.fsf.org\">their Web site</link> or by writing to: Free Software "
|
|
Packit |
1470ea |
"Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1335, USA."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Das vorliegende Dokument kann gemäß den Bedingungen der GNU Free Documentation "
|
|
Packit |
1470ea |
"License (GFDL), Version 1.1 oder jeder späteren, von der Free Software "
|
|
Packit |
1470ea |
"Foundation veröffentlichten Version ohne unveränderbare Abschnitte sowie ohne "
|
|
Packit |
1470ea |
"Texte auf dem vorderen und hinteren Buchdeckel kopiert, verteilt und/oder "
|
|
Packit |
1470ea |
"modifiziert werden. Eine Kopie der GFDL finden Sie auf der
|
|
Packit |
1470ea |
"www.fsf.org\">Webseite der Free Software Foundation</link> oder schreiben Sie "
|
|
Packit |
1470ea |
"an: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA "
|
|
Packit |
1470ea |
"02110-1335, USA."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: license/p
|
|
Packit |
1470ea |
#: C/index.page:16
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Many of the names used by companies to distinguish their products and services "
|
|
Packit |
1470ea |
"are claimed as trademarks. Where those names appear in any GNOME documentation, "
|
|
Packit |
1470ea |
"and those trademarks are made aware to the members of the GNOME Documentation "
|
|
Packit |
1470ea |
"Project, the names have been printed in caps or initial caps."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Bei vielen der von Firmen zur Unterscheidung ihrer Produkte und "
|
|
Packit |
1470ea |
"Dienstleistungen verwendeten Namen handelt es sich um Marken. An den Stellen, "
|
|
Packit |
1470ea |
"an denen derartige Namen in einer GNOME-Dokumentation vorkommen und wenn die "
|
|
Packit |
1470ea |
"Mitglieder des GNOME-Dokumentationsprojekts über diese Marken informiert "
|
|
Packit |
1470ea |
"wurden, sind die Namen in Großbuchstaben oder mit großen Anfangsbuchstaben "
|
|
Packit |
1470ea |
"geschrieben."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: credit/years
|
|
Packit |
1470ea |
#: C/index.page:24 C/index.page:28
|
|
Packit |
1470ea |
msgid "2004-2005"
|
|
Packit |
1470ea |
msgstr "2004-2005"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: credit/name
|
|
Packit |
1470ea |
#: C/index.page:25
|
|
Packit |
1470ea |
msgid "Callum McKenzie"
|
|
Packit |
1470ea |
msgstr "Callum McKenzie"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: credit/name
|
|
Packit |
1470ea |
#: C/index.page:29
|
|
Packit |
1470ea |
msgid "Robert Love"
|
|
Packit |
1470ea |
msgstr "Robert Love"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: info/desc
|
|
Packit |
1470ea |
#: C/index.page:32
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Software can be optimized in many ways: for speed, program size, or memory use. "
|
|
Packit |
1470ea |
"This section contains guides and tutorials for optimizing your software."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Die Optimierung von Software kann verschiedene Ziele verfolgen: "
|
|
Packit |
1470ea |
"Geschwindigkeit, Programmgröße oder Speicherverbrauch. Dieser Abschnitt enthält "
|
|
Packit |
1470ea |
"Leitfäden und Anleitungen zum Optimieren Ihrer Software."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: page/title
|
|
Packit |
1470ea |
#: C/index.page:35
|
|
Packit |
1470ea |
msgid "Optimization Guide"
|
|
Packit |
1470ea |
msgstr "Optimierungs-Handbuch"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/title
|
|
Packit |
1470ea |
#: C/index.page:38 C/massif.page:12
|
|
Packit |
1470ea |
msgid "Introduction"
|
|
Packit |
1470ea |
msgstr "Einführung"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/index.page:39
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"This is a brief introduction to optimization, both the hows and the whys. "
|
|
Packit |
1470ea |
"Details of individual tools and techniques are left for later articles, but a "
|
|
Packit |
1470ea |
"collection of hints and tricks is provided."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Dies ist eine kurze Einführung in die Optimierung und behandelt sowohl das Wie "
|
|
Packit |
1470ea |
"als auch das Warum. Details zu individuellen Werkzeugen verschieben wir auf "
|
|
Packit |
1470ea |
"spätere Artikel, eine Sammlung aus Hinweisen und Tricks ist jedoch enthalten."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/title
|
|
Packit |
1470ea |
#: C/index.page:45
|
|
Packit |
1470ea |
msgid "Massif"
|
|
Packit |
1470ea |
msgstr "Massif"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#. (itstool) path: page/p
|
|
Packit |
1470ea |
#: C/index.page:46 C/massif.page:9
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"This article describes how to use the <app>Massif</app> heap profiler with "
|
|
Packit |
1470ea |
"GNOME applications. We describe how to invoke, interpret, and act on the output "
|
|
Packit |
1470ea |
"of <app>Massif</app>. The <app>Swell Foop</app> game is used as an example."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Dieser Artikel beschreibt, wie Sie den Heap-Profiler <app>Massif</app> mit "
|
|
Packit |
1470ea |
"GNOME-Anwendungen verwenden. Wir beschreiben den Aufruf, die Interpretation und "
|
|
Packit |
1470ea |
"die Möglichkeiten, die Ausgaben von <app>Massif</app> richtig zu nutzen. Das "
|
|
Packit |
1470ea |
"Spiel <app>Swell Foop</app> wird als Beispiel verwendet."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/title
|
|
Packit |
1470ea |
#: C/index.page:53
|
|
Packit |
1470ea |
msgid "Harmfulness"
|
|
Packit |
1470ea |
msgstr "Schädlichkeit"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: page/title
|
|
Packit |
1470ea |
#: C/introduction.page:7
|
|
Packit |
1470ea |
msgid "What are we Optimizing?"
|
|
Packit |
1470ea |
msgstr "Was optimieren wir?"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: page/p
|
|
Packit |
1470ea |
#: C/introduction.page:8
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"When we optimize for GNOME the first thing to remember is this: we are not "
|
|
Packit |
1470ea |
"trying to make the program better, we are trying to make the person using the "
|
|
Packit |
1470ea |
"computer happier."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Sie sollten bei der Optimierung für GNOME zunächst eines bedenken: Wir "
|
|
Packit |
1470ea |
"versuchen nicht, das Programm zu verbessern, sondern wir versuchen, die "
|
|
Packit |
1470ea |
"Benutzer glücklicher zu machen."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: page/p
|
|
Packit |
1470ea |
#: C/introduction.page:10
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Better programs make people happier, but there are some improvements that will "
|
|
Packit |
1470ea |
"make them a lot happier than others: Responsiveness, start-up time, easy to "
|
|
Packit |
1470ea |
"access commands and not having the computer go into swap the moment more than "
|
|
Packit |
1470ea |
"two programs are open."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Bessere Programme machen die Benutzer glücklicher, aber es gibt "
|
|
Packit |
1470ea |
"Verbesserungsmöglichkeiten, die sie viel glücklicher machen werden als Andere: "
|
|
Packit |
1470ea |
"Ansprechzeit, Startzeit, leichter Zugriff auf Befehle. Der Rechner sollte auch "
|
|
Packit |
1470ea |
"nicht sofort den Auslagerungsspeicher benutzen müssen, wenn mehr als eine "
|
|
Packit |
1470ea |
"Anwendung geöffnet ist."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: page/p
|
|
Packit |
1470ea |
#: C/introduction.page:13
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Traditional optimization tackles concepts like CPU use, code size, the number "
|
|
Packit |
1470ea |
"of mouse clicks and the memory use of the program. This second list has been "
|
|
Packit |
1470ea |
"chosen to correlate with the first list, however there is an important "
|
|
Packit |
1470ea |
"difference: The person using GNOME doesn't care about the second list, but they "
|
|
Packit |
1470ea |
"care a lot about the first list. When optimizing GNOME programs we will reduce "
|
|
Packit |
1470ea |
"CPU use, memory use and all those things, but these are the means to the end, "
|
|
Packit |
1470ea |
"not the final goal. We are optimizing for people."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Die traditionelle Optimierung umfasst Konzepte wie Prozessorlast, Umfang des "
|
|
Packit |
1470ea |
"Codes, die Anzahl der Mausklicks sowie die Speichernutzung des Programms. Die "
|
|
Packit |
1470ea |
"folgende Auflistung sollte die erste Liste ergänzen, wobei ein grundlegender "
|
|
Packit |
1470ea |
"Unterschied besteht: Ein GNOME-Benutzer schenkt der zweiten Liste keine "
|
|
Packit |
1470ea |
"Beachtung, während der ersten Liste sehr wohl Aufmerksamkeit gewidmet wird. "
|
|
Packit |
1470ea |
"Beim Optimieren von GNOME-Programmen sollen die Prozessorlast, der "
|
|
Packit |
1470ea |
"Speicherverbrauch und all diese Dinge optimiert werden, aber das sind die "
|
|
Packit |
1470ea |
"Bedeutungen, nicht das Endziel. Wir optimieren für Benutzer."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/title
|
|
Packit |
1470ea |
#: C/introduction.page:18
|
|
Packit |
1470ea |
msgid "Doing the Optimization"
|
|
Packit |
1470ea |
msgstr "Ausführung der Optimierung"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/introduction.page:19
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"The previous section omitted one important qualifier: To optimize something it "
|
|
Packit |
1470ea |
"has to be measurable. You can't measure happiness. However, you can measure "
|
|
Packit |
1470ea |
"start-up time so you can tell if you have improved it. Happiness will then, "
|
|
Packit |
1470ea |
"hopefully, follow."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Aus dem vorigen Abschnitt wurde deutlich: Um etwas optimieren zu können, muss "
|
|
Packit |
1470ea |
"es messbar sein. Sie können Zufriedenheit nicht messen, aber Sie können sehr "
|
|
Packit |
1470ea |
"wohl Startzeiten messen, um sagen zu können, dass Sie sie verbessert haben. Die "
|
|
Packit |
1470ea |
"Zufriedenheit wird dann - hoffentlich - folgen."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/introduction.page:22
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Optimization is the process of measurement, refinement and re-measurement. So "
|
|
Packit |
1470ea |
"the first thing you must do is find a way to measure what you are optimizing. "
|
|
Packit |
1470ea |
"Ideally this measurement is a single number, for example: the time taken to "
|
|
Packit |
1470ea |
"perform a task. This is your benchmark, it is the only way to tell if you are "
|
|
Packit |
1470ea |
"winning or losing. There is a big difference between a program that should</"
|
|
Packit |
1470ea |
"em> be fast and a program that is fast."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Optimierung ist ein Prozess des Messens, der Verfeinerung und erneuten Messens. "
|
|
Packit |
1470ea |
"Daher müssen Sie zunächst einen Weg finden, das zu messen, was Sie optimieren "
|
|
Packit |
1470ea |
"wollen. Idealerweise ist dieser Messwert eine einzige Zahl, beispielsweise die "
|
|
Packit |
1470ea |
"Zeit, die für die Ausführung einer Aufgabe benötigt wird. Dies ist Ihr Maßstab, "
|
|
Packit |
1470ea |
"es ist der einzige Weg festzustellen, ob Sie auf der Gewinner- oder der "
|
|
Packit |
1470ea |
"Verliererseite sind. Es ist ein sehr wesentlicher Unterschied, ob ein Programm "
|
|
Packit |
1470ea |
"schnell sein sollte oder ob es tatsächlich schnell ist."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/introduction.page:25
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Once you have a basic benchmark you need to find out why your code is not doing "
|
|
Packit |
1470ea |
"as well as it should. It is tempting to do this by inspection: just looking at "
|
|
Packit |
1470ea |
"the code and trying to spot something that looks like it needs improvement. You "
|
|
Packit |
1470ea |
"will invariably be wrong. Using a profiler to get a detailed break-down of what "
|
|
Packit |
1470ea |
"your program really does is the only way to be sure."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Sobald Sie einen Ausgangsmaßstab gefunden haben, müssen Sie nun herausfinden, "
|
|
Packit |
1470ea |
"warum Ihr Code seine Aufgabe nicht so gut erledigt, wie er es eigentlich "
|
|
Packit |
1470ea |
"sollte. Es ist verlockend, dies durch eine einfache Sichtung zu tun: Sich den "
|
|
Packit |
1470ea |
"Code anzuschauen und etwas zu finden, dass verbesserungswürdig scheint. Doch "
|
|
Packit |
1470ea |
"Sie werden immer falsch liegen. Der einzig sichere Weg ist es, einen Profiler "
|
|
Packit |
1470ea |
"für eine detaillierte Aufschlüsselung der Programmaktivitäten zu verwenden."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/introduction.page:28
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Usually the problem is isolated to small sections of code. Pick the worst place "
|
|
Packit |
1470ea |
"and concentrate on that first. Once that is done, rerun the profiler and "
|
|
Packit |
1470ea |
"repeat. As you proceed the gains made at each step will get less and less, at "
|
|
Packit |
1470ea |
"some point you will have to decide that the results are good enough. If your "
|
|
Packit |
1470ea |
"efforts are only extracting 10% improvements then you are well past the point "
|
|
Packit |
1470ea |
"where you should have stopped."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Gewöhnlich ist das Problem auf kleine Code-Abschnitte beschränkt. Wählen Sie "
|
|
Packit |
1470ea |
"den schlimmsten Teil und konzentrieren Sie sich zuerst darauf. Führen Sie den "
|
|
Packit |
1470ea |
"Profiler erneut aus und wiederholen Sie den Arbeitsschritt, sobald dies "
|
|
Packit |
1470ea |
"erledigt ist. Wenn Sie so arbeiten, werden die Gewinne mit jedem Schritt "
|
|
Packit |
1470ea |
"geringer. Ab einem bestimmten Punkt müssen Sie entscheiden, dass die Ergebnisse "
|
|
Packit |
1470ea |
"gut genug sind. Wenn Ihre Bemühungen nur 10% Verbesserung ergeben, dann sind "
|
|
Packit |
1470ea |
"Sie bereits weit über den Punkt hinaus, wo Sie hätten stoppen sollen."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/introduction.page:31
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Don't forget the big picture. For example, rather than just trying to speed up "
|
|
Packit |
1470ea |
"a piece of code, ask yourself if it needs to be run at all. Could it be "
|
|
Packit |
1470ea |
"combined with another piece of code? Can the results of previous calculations "
|
|
Packit |
1470ea |
"be saved and reused? It won't even need to be optimized if it is in a place "
|
|
Packit |
1470ea |
"where the user is never going to notice it. Worse still, the code may already "
|
|
Packit |
1470ea |
"be optimized and is doing the heavy calculations now to avoid doing them later. "
|
|
Packit |
1470ea |
"Code does not run in isolation and neither does the optimization process."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Vergessen Sie nicht das Gesamtbild. Zum Beispiel sollten Sie sich fragen, ob "
|
|
Packit |
1470ea |
"der Code überhaupt unbedingt ausgeführt werden muss, statt seine "
|
|
Packit |
1470ea |
"Geschwindigkeit zu verbessern. Kann er mit anderem Code kombiniert werden? "
|
|
Packit |
1470ea |
"Können bereits ausgeführte Berechnungen gespeichert und später wieder verwertet "
|
|
Packit |
1470ea |
"werden? Eine Optimierung kann man sich auch sparen, wenn der Code dort "
|
|
Packit |
1470ea |
"ausgeführt wird, wo ihn der Benutzer niemals bemerken wird. Noch schlimmer, der "
|
|
Packit |
1470ea |
"Code ist eventuell bereits optimiert und führt kostspielige Berechnungen jetzt "
|
|
Packit |
1470ea |
"aus, um dies später zu vermeiden. Code läuft nicht isoliert und ebenso wenig "
|
|
Packit |
1470ea |
"der Optimierungsprozess."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/title
|
|
Packit |
1470ea |
#: C/introduction.page:37
|
|
Packit |
1470ea |
msgid "Hints"
|
|
Packit |
1470ea |
msgstr "Hinweise"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/title
|
|
Packit |
1470ea |
#: C/introduction.page:41
|
|
Packit |
1470ea |
msgid "The Fundamentals"
|
|
Packit |
1470ea |
msgstr "Die Grundlagen"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:44
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Re-run your benchmark after every change you make to the code and keep a log of "
|
|
Packit |
1470ea |
"everything you change and how it affects the benchmark. This lets you undo "
|
|
Packit |
1470ea |
"mistakes and also helps you not to repeat mistakes."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Bilden Sie einen Maßstab nach jeder Code-Änderung aus und führen Sie Buch über "
|
|
Packit |
1470ea |
"alle Änderungen, und wie sie den Maßstab beeinflussen. So können Sie Fehler "
|
|
Packit |
1470ea |
"rückgängig machen und in Zukunft erst gar nicht wiederholen."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:49
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Make sure your code is correct and bug-free before optimizing it. Check that it "
|
|
Packit |
1470ea |
"remains correct and bug-free after optimization."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Stellen Sie sicher, dass Ihr Code korrekt und fehlerfrei ist, bevor Sie mit der "
|
|
Packit |
1470ea |
"Optimierung beginnen. Überprüfen Sie nach der Optimierung, ob dies dann auch "
|
|
Packit |
1470ea |
"noch zutrifft."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:54
|
|
Packit |
1470ea |
msgid "Optimize at the high level before optimizing the details."
|
|
Packit |
1470ea |
msgstr "Optimieren Sie zunächst auf hoher Ebene, bevor es an die Details geht."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:59
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Use the right algorithm. The classic text-book example is using quick-sort "
|
|
Packit |
1470ea |
"instead of bubble-sort. There are many others, some save memory, some save CPU. "
|
|
Packit |
1470ea |
"Also, see what shortcuts you can make: you can do quicker than quick-sort if "
|
|
Packit |
1470ea |
"you are prepared to make some compromises."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Verwenden Sie den passenden Algorithmus. Das klassische Beispiel ist, Quick-"
|
|
Packit |
1470ea |
"Sort statt Bubble-Sort zu verwenden. Es gibt viele andere. Einige belegen wenig "
|
|
Packit |
1470ea |
"Arbeitsspeicher, andere brauchen wenig Rechenleistung. Schauen Sie auch, ob Sie "
|
|
Packit |
1470ea |
"Kompromisse eingehen können: Es geht auch schneller als Quick-Sort."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:64
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Optimization is a trade-off. Caching results speeds up calculations, but "
|
|
Packit |
1470ea |
"increases memory use. Saving data to disk saves memory, but costs time when it "
|
|
Packit |
1470ea |
"is loaded back from disk."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Optimierungen sind ein Abwägen. Ergebnisse zwischenzuspeichern beschleunigt "
|
|
Packit |
1470ea |
"Berechnungen, aber erhöht den Speicherverbrauch. Daten auf einen Datenträger zu "
|
|
Packit |
1470ea |
"speichern spart Arbeitsspeicher, aber kostet Zeit beim Laden vom Datenträger."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:69
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Make sure you choose a wide variety of inputs to optimize against. If you don't "
|
|
Packit |
1470ea |
"it is easy to end up with a piece of code carefully optimized for one file and "
|
|
Packit |
1470ea |
"no others."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Wählen Sie unbedingt eine große Vielfalt an Eingangsgrößen, die Sie optimieren. "
|
|
Packit |
1470ea |
"Wenn Sie dies nicht tun, können Sie schnell mit einem sorgfältig für nur eine "
|
|
Packit |
1470ea |
"einzige Datei optimierten Code enden."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:74
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Avoid expensive operations: Multiple small disk reads. Using up lots of memory "
|
|
Packit |
1470ea |
"so disk swapping becomes necessary. Avoid anything that writes or reads from "
|
|
Packit |
1470ea |
"the hard disk unnecessarily. The network is slow too. Also avoid graphics "
|
|
Packit |
1470ea |
"operations that need a response from the X server."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Vermeiden Sie aufwändige Vorgänge: Mehrere kleine Plattenlesevorgänge, Belegung "
|
|
Packit |
1470ea |
"von sehr viel Arbeitsspeicher, bis das Auslagern beginnt. Vermeiden Sie "
|
|
Packit |
1470ea |
"unnötige Schreib- und Lesevorgänge auf Datenträger. Das Netzwerk ist auch "
|
|
Packit |
1470ea |
"langsam. Vermeiden Sie auch grafische Operationen, die eine Antwort vom X-"
|
|
Packit |
1470ea |
"Server erfordern."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/title
|
|
Packit |
1470ea |
#: C/introduction.page:81
|
|
Packit |
1470ea |
msgid "Traps for the Unwary"
|
|
Packit |
1470ea |
msgstr "Fallen für die Unvorsichtigen"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:84
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Beware of side effects. There can often be strange interactions between "
|
|
Packit |
1470ea |
"different sections of code, a speed-up in one part can slow another part down."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Nehmen Sie sich vor Nebeneffekten in Acht. Es kann oft seltsame Interaktionen "
|
|
Packit |
1470ea |
"zwischen verschiedenen Code-Bereichen geben. Eine Geschwindigkeitsverbesserung "
|
|
Packit |
1470ea |
"in einem Teil kann einen anderen Teil ausbremsen. "
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:89
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"When timing code, even on a quiet system, events outside the program add noise "
|
|
Packit |
1470ea |
"to the timing results. Average over multiple runs. If the code is very short, "
|
|
Packit |
1470ea |
"timer resolution is also a problem. In this case measure the time the computer "
|
|
Packit |
1470ea |
"takes to run the code 100 or 1000 times. If the times you are recording are "
|
|
Packit |
1470ea |
"longer than a few seconds, you should be OK."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Beim zeitlichen Abstimmen von Code - auch auf unbelasteten Systemen - sorgen "
|
|
Packit |
1470ea |
"externe Ereignisse für Unregelmäßigkeiten bei der Zeitplanung. Bilden Sie "
|
|
Packit |
1470ea |
"Durchschnittswerte von mehreren Durchläufen. Wenn der Code sehr kurz ist, so "
|
|
Packit |
1470ea |
"kann die Zählergenauigkeit zu einem Problem werden. In diesem Fall messen Sie "
|
|
Packit |
1470ea |
"die Zeit 100 oder 1000 Mal, die der Rechner zur Abarbeitung braucht. Wenn Sie "
|
|
Packit |
1470ea |
"Zeitspannen von einigen Sekunden messen, dann sind Sie im grünen Bereich."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:94
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"It is very easy to be misled by the profiler. There are stories of people "
|
|
Packit |
1470ea |
"optimizing the operating system idle-loop because that is where it spent all "
|
|
Packit |
1470ea |
"its time! Don't optimize code that does nothing the user cares about."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Es ist sehr leicht, vom Profiler in die Irre geführt zu werden. Es gibt "
|
|
Packit |
1470ea |
"Geschichten über Leute, die die Untätigkeitsphase perfekt optimiert haben, weil "
|
|
Packit |
1470ea |
"das Programm ja die meiste Zeit in Untätigkeit verbringt! Optimieren Sie keinen "
|
|
Packit |
1470ea |
"Code, von dessen Wirkung der Benutzer ohnehin keine Notiz nimmt."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:99
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Remember the resources on the X server. Your program's memory usage doesn't "
|
|
Packit |
1470ea |
"include the pixmaps that are stored in the X server's process, but they are "
|
|
Packit |
1470ea |
"still using up memory. Use xrestop to see what resources your program is using."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Vergessen Sie nicht den Ressourcenverbrauch des X-Servers. Der "
|
|
Packit |
1470ea |
"Speicherverbrauch Ihres Programms enthält nicht die Pixmaps, die vom X-Server "
|
|
Packit |
1470ea |
"verarbeitet werden, aber sie verbrauchen dennoch Speicher. Verwenden Sie "
|
|
Packit |
1470ea |
"<command>xrestop</command>, um zu sehen, welche Ressourcen Ihr Programm "
|
|
Packit |
1470ea |
"beansprucht."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/title
|
|
Packit |
1470ea |
#: C/introduction.page:106
|
|
Packit |
1470ea |
msgid "Low Level Hints"
|
|
Packit |
1470ea |
msgstr "Tipps mit niedrigem Niveau"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:109
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"When optimizing memory use, be wary of the difference between peak usage and "
|
|
Packit |
1470ea |
"average memory usage. Some memory is almost always allocated, this is usually "
|
|
Packit |
1470ea |
"bad. Some is only briefly allocated, this may be quite acceptable. Tools like "
|
|
Packit |
1470ea |
"massif use the concept of space-time, the product of memory used and the "
|
|
Packit |
1470ea |
"duration it was allocated for, instead."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Seien Sie bei der Optimierung des Speicherverbrauchs umsichtig bezüglich des "
|
|
Packit |
1470ea |
"Unterschieds zwischen Spitzen- und durchschnittlicher Speicherbelegung. Einiger "
|
|
Packit |
1470ea |
"Speicher wird quasi immer belegt, das ist nicht gut. Einiger wird nur "
|
|
Packit |
1470ea |
"kurzzeitig belegt, dies ist in Ordnung. Werkzeuge wie »massif« verwenden das "
|
|
Packit |
1470ea |
"Raum-Zeit-Konzept, d.h. das Produkt von belegtem Arbeitsspeicher und der "
|
|
Packit |
1470ea |
"Belegungsdauer."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:114
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Time simplified bits of code that do only the things you know are essential, "
|
|
Packit |
1470ea |
"this gives an absolute lower limit on the time your code will take. For "
|
|
Packit |
1470ea |
"example, when optimizing a loop time the empty loop. If that is still too long "
|
|
Packit |
1470ea |
"no amount of micro-optimization will help and you will have to change your "
|
|
Packit |
1470ea |
"design. Make sure the compiler doesn't optimize away your empty loop."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Stoppen Sie die Zeit vereinfachter Code-Teile, die nur Entscheidendes "
|
|
Packit |
1470ea |
"erledigen. Dies legt eine absolute untere Grenze für die Laufzeit Ihres Codes "
|
|
Packit |
1470ea |
"fest. Zum Beispiel sollten Sie beim Optimieren einer Schleife die leere "
|
|
Packit |
1470ea |
"Schleife stoppen. Wenn dies immer noch zu lang ist, dann wird keine Mikro-"
|
|
Packit |
1470ea |
"Optimierung Abhilfe schaffen und Sie müssen das grundlegende Design ändern. "
|
|
Packit |
1470ea |
"Stellen Sie sicher, dass der Compiler dabei nicht ihre leeren Schleifen "
|
|
Packit |
1470ea |
"rationalisiert."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:119
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Move code out from inside loops. A slightly more complicated piece of code that "
|
|
Packit |
1470ea |
"is executed once is far quicker than a simple piece of code executed a thousand "
|
|
Packit |
1470ea |
"times. Avoid calling slow code often."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Gliedern Sie Code aus Schleifen aus. Ein etwas umfangreicheres Stück Code, das "
|
|
Packit |
1470ea |
"nur einmal ausgeführt wird, ist um Einiges schneller als ein simples Stück "
|
|
Packit |
1470ea |
"Code, was dafür tausend Schleifen durchläuft. Vermeiden Sie es, langsamen Code "
|
|
Packit |
1470ea |
"allzu oft aufzurufen."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:124
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Give the compiler as many hints as possible. Use the const keyword. Use "
|
|
Packit |
1470ea |
"G_INLINE_FUNC for short, frequently called, functions. Look up "
|
|
Packit |
1470ea |
"G_GNUC_PURE , G_LIKELY and the other glib "
|
|
Packit |
1470ea |
"miscellaneous macros. Use the macros instead of gcc-specific keywords to ensure "
|
|
Packit |
1470ea |
"portability."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Geben Sie dem Compiler so viele Hinweise wie möglich. Verwenden Sie das const-"
|
|
Packit |
1470ea |
"Schlüsselwort. Verwenden Sie G_INLINE_FUNC für kurze, häufig "
|
|
Packit |
1470ea |
"aufgerufene Funktionen. Schauen Sie nach G_GNUC_PURE , "
|
|
Packit |
1470ea |
"G_LIKELY und weiteren diversen glib-Makros. Verwenden Sie diese "
|
|
Packit |
1470ea |
"Makros anstelle der gcc-spezifischen Schlüsselwörter, um die Portierbarkeit zu "
|
|
Packit |
1470ea |
"erhalten."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:129
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Don't use assembly language. It is not portable and, while it may be fast on "
|
|
Packit |
1470ea |
"one processor, it is not even guaranteed to be fast on every processor that "
|
|
Packit |
1470ea |
"supports that architecture (e.g. Athlon vs. Pentium 4)."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Verwenden Sie keine Assemblersprachen. Sie sind nicht portierbar. Während sie "
|
|
Packit |
1470ea |
"auf dem einen Prozessor unglaublich schnell sind, ist nicht unbedingt "
|
|
Packit |
1470ea |
"garantiert, dass dies auf jedem von der Architektur unterstützten Prozessor "
|
|
Packit |
1470ea |
"genauso ist (beispielsweise Athlon vs Pentium 4)."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:134
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Don't rewrite an existing library routine unless you are sure it is "
|
|
Packit |
1470ea |
"unnecessarily slow. Many CPU-intensive library routines have already been "
|
|
Packit |
1470ea |
"optimized. Conversely, some library routines are slow, especially ones that "
|
|
Packit |
1470ea |
"make system calls to the operating system."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Schreiben Sie eine vorhandene Bibliotheksroutine nicht neu, es sei denn, Sie "
|
|
Packit |
1470ea |
"sind sich sicher, dass sie unakzeptabel langsam ist. Viele prozessorintensive "
|
|
Packit |
1470ea |
"Bibliotheksroutinen wurden bereits optimiert. Andererseits sind einige Routinen "
|
|
Packit |
1470ea |
"tatsächlich langsam, insbesondere diejenigen, die Systemaufrufe an das "
|
|
Packit |
1470ea |
"Betriebssystem absetzen."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:139
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Minimize the number of libraries you link to. The fewer libraries to link in, "
|
|
Packit |
1470ea |
"the faster the program starts. This is a difficult thing to do with GNOME."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Halten Sie die Zahl der verlinkten Bibliotheken gering. Je weniger Bibliotheken "
|
|
Packit |
1470ea |
"gelinkt werden müssen, umso schneller startet das Programm. Dies ist in GNOME "
|
|
Packit |
1470ea |
"allerdings schwierig."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/title
|
|
Packit |
1470ea |
#: C/introduction.page:146
|
|
Packit |
1470ea |
msgid "High Level Tricks"
|
|
Packit |
1470ea |
msgstr "Tricks auf hohem Niveau"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:149
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Take advantage of concurrency. This doesn't just mean using multiple "
|
|
Packit |
1470ea |
"processors, it also means taking advantage of the time the user spends thinking "
|
|
Packit |
1470ea |
"about what they are going to do next to perform some calculations in "
|
|
Packit |
1470ea |
"anticipation. Do calculations while waiting for data to be loaded off disk. "
|
|
Packit |
1470ea |
"Take advantage of multiple resources, use them all at once."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Nutzen Sie Nebenläufigkeit aus. Das bedeutet nicht nur mehrere Prozessoren zu "
|
|
Packit |
1470ea |
"verwenden, es bedeutet auch die Zeit auszunutzen, in welcher der Anwender über "
|
|
Packit |
1470ea |
"seine weiteren Aktivitäten nachdenkt, und in Vorausschau einige Berechnungen "
|
|
Packit |
1470ea |
"auszuführen. Führen Sie Berechnungen aus, während Daten vom Datenträger geladen "
|
|
Packit |
1470ea |
"werden. Nutzen Sie verschiedene Ressourcen, wenn vorhanden, gleichzeitig."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:154
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Cheat. The user only has to think that the computer is fast, it doesn't matter "
|
|
Packit |
1470ea |
"whether it actually is or not. It is the time between the command and the "
|
|
Packit |
1470ea |
"answer that is important, it doesn't matter if the response is pre-calculated, "
|
|
Packit |
1470ea |
"cached, or will in fact be worked out later at a more convenient time, as long "
|
|
Packit |
1470ea |
"as the user gets what they expect."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Bluffen Sie. Der Benutzer sollte denken, dass sein Rechner schnell ist, aber es "
|
|
Packit |
1470ea |
"ist gleich, ob er es wirklich ist oder nicht. Die Zeit zwischen dem Befehl und "
|
|
Packit |
1470ea |
"der darauf folgenden Antwort ist maßgebend. Es ist gleichgültig, ob die Antwort "
|
|
Packit |
1470ea |
"vorausberechnet wird, zwischengespeichert oder in irgendeiner anderen Weise "
|
|
Packit |
1470ea |
"später zu einem günstigeren Zeitpunkt ausgewertet wird, solange der Benutzer "
|
|
Packit |
1470ea |
"genau das bekommt, was er erwartet."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:159
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Do things in the idle loop. It is easier to program than using full multi-"
|
|
Packit |
1470ea |
"threading but still gets things done out of the users eye. Be careful though, "
|
|
Packit |
1470ea |
"if you spend too long in the idle loop your program will become sluggish. So "
|
|
Packit |
1470ea |
"regularly give control back to the main loop."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Erledigen Sie Dinge in der Idle-Schleife. Dies ist einfacher zu programmieren "
|
|
Packit |
1470ea |
"als Multi-Threading, aber die Dinge geschehen vom Benutzer unbemerkt. Seien Sie "
|
|
Packit |
1470ea |
"jedoch vorsichtig. Wenn Ihr Programm sehr viel Zeit in der Idle-Schleife "
|
|
Packit |
1470ea |
"verbringt, dann wird es träge. Stellen Sie sicher, dass die Kontrolle "
|
|
Packit |
1470ea |
"regelmäßig an die Hauptschleife übergeben wird."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: item/p
|
|
Packit |
1470ea |
#: C/introduction.page:164
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"If all else fails, tell the user that the code is going to be slow and put up a "
|
|
Packit |
1470ea |
"progress bar. They won't be as happy as if you had just presented the results, "
|
|
Packit |
1470ea |
"but they will at least know the program hasn't crashed and they can go get a "
|
|
Packit |
1470ea |
"cup of coffee."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Falls alles Andere scheitern sollte, informieren Sie den Benutzer mit einem "
|
|
Packit |
1470ea |
"Fortschrittsbalken drüber, dass es derzeit nur langsam voran geht. Das dürfte "
|
|
Packit |
1470ea |
"ihm lieber sein, als wenn Sie nur die Ergebnisse präsentieren würden. Er möchte "
|
|
Packit |
1470ea |
"zumindest wissen, dass das Programm nicht abgestürzt ist und er dann erst "
|
|
Packit |
1470ea |
"einmal eine Tasse Kaffee trinken gehen kann."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: media
|
|
Packit |
1470ea |
#. This is a reference to an external file such as an image or video. When
|
|
Packit |
1470ea |
#. the file changes, the md5 hash will change to let you know you need to
|
|
Packit |
1470ea |
#. update your localized copy. The msgstr is not used at all. Set it to
|
|
Packit |
1470ea |
#. whatever you like once you have updated your copy of the file.
|
|
Packit |
1470ea |
#: C/massif.page:50
|
|
Packit |
1470ea |
msgctxt "_"
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"external ref='figures/massif-before.png' md5='1a6b2ace548e6789ab8bfacb3727b345'"
|
|
Packit |
1470ea |
msgstr "ok"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: media
|
|
Packit |
1470ea |
#. This is a reference to an external file such as an image or video. When
|
|
Packit |
1470ea |
#. the file changes, the md5 hash will change to let you know you need to
|
|
Packit |
1470ea |
#. update your localized copy. The msgstr is not used at all. Set it to
|
|
Packit |
1470ea |
#. whatever you like once you have updated your copy of the file.
|
|
Packit |
1470ea |
#: C/massif.page:124
|
|
Packit |
1470ea |
msgctxt "_"
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"external ref='figures/massif-after.png' md5='36d1b4ad7ab49b28b69ad3eabbaa7069'"
|
|
Packit |
1470ea |
msgstr "ok"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: page/title
|
|
Packit |
1470ea |
#: C/massif.page:7
|
|
Packit |
1470ea |
msgid "Using <app>Massif</app> for Profiling Memory Use in GNOME Software"
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Verwendung von <app>Massif</app> zur Profilierung des Speicherverbrauchs in "
|
|
Packit |
1470ea |
"GNOME-Software"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:13
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"<app>Massif</app> is a member of the
|
|
Packit |
1470ea |
"\">valgrind</link> suite of memory-profiling tools. Its purpose is to give a "
|
|
Packit |
1470ea |
"detailed view of dynamic memory usage during the lifetime of the program. "
|
|
Packit |
1470ea |
"Specifically it records the memory use of the heap and the stack."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"<app>Massif</app> ist Teil der Programmsammlung
|
|
Packit |
1470ea |
"org/\">valgrind</link>, die Werkzeuge zur Speicherprofilierung bereitstellt. "
|
|
Packit |
1470ea |
"Zweck ist die Erstellung eines detaillierten Überblicks über die dynamische "
|
|
Packit |
1470ea |
"Speichernutzung während der Lebensdauer eines Programms. Speziell wird der "
|
|
Packit |
1470ea |
"Speicherverbrauch von »heap« und »stack« aufgezeichnet."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:16
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"The heap is the region of memory which is allocated with functions like malloc. "
|
|
Packit |
1470ea |
"It grows on demand and is usually the largest region of memory in a program. "
|
|
Packit |
1470ea |
"The stack is where all the local data for functions is stored. This includes "
|
|
Packit |
1470ea |
"the \"automatic\" variables in C and the return address for subroutines. The "
|
|
Packit |
1470ea |
"stack is typically a lot smaller and a lot more active than the heap. We won't "
|
|
Packit |
1470ea |
"consider the stack explicitly since <app>Massif</app> treats it as though it "
|
|
Packit |
1470ea |
"were just another part of the heap. <app>Massif</app> also gives information "
|
|
Packit |
1470ea |
"about how much memory is used to manage the heap."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Der Heap ist der Speicherbereich, der von Funktionen wie »malloc« belegt wird. "
|
|
Packit |
1470ea |
"Er wächst bei Bedarf und ist gewöhnlich der größte Speicherbereich eines "
|
|
Packit |
1470ea |
"Programms. Der Stapelspeicher (Stack) dient zur Speicherung der lokalen Daten "
|
|
Packit |
1470ea |
"von Funktionen. Dies schließt »automatische« Variablen in C und die "
|
|
Packit |
1470ea |
"Rückgabeadresse von Subroutinen ein. Der Stapelspeicher ist typischerweise "
|
|
Packit |
1470ea |
"wesentlich kleiner und deutlich aktiver als der Heap. Wir werden den "
|
|
Packit |
1470ea |
"Stapelspeicher nicht gesondert betrachten, weil ihn <app>Massif</app> wie einen "
|
|
Packit |
1470ea |
"weiteren Teil des Heap ansieht. <app>Massif</app> liefert auch Informationen "
|
|
Packit |
1470ea |
"darüber, wie viel Arbeitsspeicher für den Heap belegt wird."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:18
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"<app>Massif</app> produces two output files: a graphical overview in a "
|
|
Packit |
1470ea |
"postscript file and a detailed breakdown in a text file."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"<app>Massif</app> erstellt zwei Ausgabdateien: eine grafische Übersicht in "
|
|
Packit |
1470ea |
"einer PostScript-Datei und eine detaillierte Ausgabe in einer Textdatei."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/title
|
|
Packit |
1470ea |
#: C/massif.page:23
|
|
Packit |
1470ea |
msgid "Using <app>Massif</app> with GNOME"
|
|
Packit |
1470ea |
msgstr "<app>Massif</app> mit GNOME verwenden"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:24
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"<app>Massif</app> has very few options and for many programs does not need "
|
|
Packit |
1470ea |
"them. However for GNOME applications, where memory allocation might be buried "
|
|
Packit |
1470ea |
"deep in either glib or GTK, the number of levels down the call-stack Massif "
|
|
Packit |
1470ea |
"descends needs to be increased. This is achieved using the --depth parameter. "
|
|
Packit |
1470ea |
"By default this is 3; increasing it to 5 will guarantee the call-stack reaches "
|
|
Packit |
1470ea |
"down to your code. One or two more levels may also be desirable to provide your "
|
|
Packit |
1470ea |
"code with some context. Since the level of detail becomes quickly overwhelming "
|
|
Packit |
1470ea |
"it is best to start with the smaller depth parameter and only increase it when "
|
|
Packit |
1470ea |
"it becomes apparent that it isn't sufficient."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"<app>Massif</app> hat sehr wenige Optionen und für viele Programme brauchen Sie "
|
|
Packit |
1470ea |
"diese auch gar nicht. Für GNOME-Anwendungen jedoch muss die Anzahl der "
|
|
Packit |
1470ea |
"Abstiegsebenen des Aufruf-Stapelspeichers erhöht werden, weil sie bei diesen "
|
|
Packit |
1470ea |
"Speicheranforderungen tief in glib oder GTK+ verborgen liegen. Dies wird mit "
|
|
Packit |
1470ea |
"dem Parameter »--depth« erreicht. Die Voreinstellung ist 3; eine Erhöhung auf 5 "
|
|
Packit |
1470ea |
"stellt sicher, dass der Aufruf-Stapelspeicher bis zu Ihrem Code reicht. Ein "
|
|
Packit |
1470ea |
"oder zwei weitere Ebenen können auch wünschenswert sein, um weiteren Kontext zu "
|
|
Packit |
1470ea |
"ersehen. Weil die Detailangaben sehr schnell erdrückend werden können ist es am "
|
|
Packit |
1470ea |
"besten, mit dem kleineren Parameter zu beginnen und ihn nur bei Bedarf zu "
|
|
Packit |
1470ea |
"erhöhen."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:27
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"It is also useful to tell <app>Massif</app> which functions allocate memory in "
|
|
Packit |
1470ea |
"glib. It removes an unnecessary layer of function calls from the reports and "
|
|
Packit |
1470ea |
"gives you a clearer idea of what code is allocating memory. The allocating "
|
|
Packit |
1470ea |
"functions in glib are g_malloc, g_malloc0, g_realloc, g_try_malloc, and "
|
|
Packit |
1470ea |
"g_mem_chunk_alloc. You use the --alloc-fn option to tell Massif about them."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Es ist auch nützlich, <app>Massif</app> mitzuteilen, welche Funktionen in glib "
|
|
Packit |
1470ea |
"Arbeitsspeicher anfordern. So wird eine unnötige Ebene Funktionsaufrufe aus den "
|
|
Packit |
1470ea |
"Berichten entfernt und verbessert den Einblick, welcher Code Speicher "
|
|
Packit |
1470ea |
"anfordert. Speicher anfordernde Funktionen in glib sind: g_malloc, g_malloc0, "
|
|
Packit |
1470ea |
"g_realloc, g_try_malloc und g_mem_chunk_alloc. Verwenden Sie die Option »--"
|
|
Packit |
1470ea |
"alloc-fn«, um Massif diese Namen mitzuteilen."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:30
|
|
Packit |
1470ea |
msgid "Your command-line should therefore look something like:"
|
|
Packit |
1470ea |
msgstr "Ihre Befehlszeile sollte daher so aussehen:"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/code
|
|
Packit |
1470ea |
#: C/massif.page:33
|
|
Packit |
1470ea |
#, no-wrap
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"valgrind --tool=massif --depth=5 --alloc-fn=g_malloc --alloc-fn=g_realloc --alloc-fn=g_try_malloc \\\n"
|
|
Packit |
1470ea |
" --alloc-fn=g_malloc0 --alloc-fn=g_mem_chunk_alloc swell-foop\n"
|
|
Packit |
1470ea |
" "
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"valgrind --tool=massif --depth=5 --alloc-fn=g_malloc --alloc-fn=g_realloc --alloc-fn=g_try_malloc \\\n"
|
|
Packit |
1470ea |
" --alloc-fn=g_malloc0 --alloc-fn=g_mem_chunk_alloc swell-foop\n"
|
|
Packit |
1470ea |
" "
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:37
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"<app>Swell Foop</app> is the program we will be using as an example. Be warned "
|
|
Packit |
1470ea |
"that, since valgrind emulates the CPU, it will run very slowly. You "
|
|
Packit |
1470ea |
"will also need a lot of memory."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Das Programm <app>Swell Foop</app> werden wir als Beispiel verwenden. Seien Sie "
|
|
Packit |
1470ea |
"gewarnt: <app>Valgrind</app> emuliert den Prozessor, wodurch es äußerst</"
|
|
Packit |
1470ea |
"em> langsam läuft. Außerdem wird sehr viel Speicher benötigt."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/title
|
|
Packit |
1470ea |
#: C/massif.page:41
|
|
Packit |
1470ea |
msgid "Interpreting the Results"
|
|
Packit |
1470ea |
msgstr "Interpretieren der Ergebnisse"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:42
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"The graphical output of <app>Massif</app> is largely self explanatory. Each "
|
|
Packit |
1470ea |
"band represents the memory allocated by one function over time. Once you "
|
|
Packit |
1470ea |
"identify which bands are using the most memory, usually the big thick ones at "
|
|
Packit |
1470ea |
"the top you will have to consult the text file for the details."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Die grafische Ausgabe von <app>Massif</app> ist weitgehend selbsterklärend. "
|
|
Packit |
1470ea |
"Jedes Band stellt den einer Funktion zugewiesenen Speicher nach Zeit dar. "
|
|
Packit |
1470ea |
"Sobald Sie herausgefunden haben, welche Bänder den meisten Speicher "
|
|
Packit |
1470ea |
"verbrauchen, üblicherweise die dickeren, oberen, dann schauen Sie sich die "
|
|
Packit |
1470ea |
"Textausgabe für weitere Details an."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:45
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"The text file is arranged as a hierarchy of sections, at the top is a list of "
|
|
Packit |
1470ea |
"the worst memory users arranged in order of decreasing spacetime. Below this "
|
|
Packit |
1470ea |
"are further sections, each breaking the results down into finer detail as you "
|
|
Packit |
1470ea |
"proceed down the call-stack. To illustrate this we will use the output of the "
|
|
Packit |
1470ea |
"command above."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Die Textdatei ist hierarchisch in Abschnitte gegliedert. Am oberen Ende finden "
|
|
Packit |
1470ea |
"sich die größten Speicherverbraucher, in absteigender Ordnung nach "
|
|
Packit |
1470ea |
"Speicherzeit. Darunter finden sich weitere Abschnitte, die je nach dem Platz im "
|
|
Packit |
1470ea |
"Aufruf-Stack feiner detaillierter sind. Um dies zu verdeutlichen, verwenden wir "
|
|
Packit |
1470ea |
"die Ausgabe des oben stehenden Befehls."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: figure/title
|
|
Packit |
1470ea |
#: C/massif.page:49
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"<app>Massif</app> output for the unoptimized version of the <app>Swell Foop</"
|
|
Packit |
1470ea |
"app> program."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"<app>Massif</app>-Ausgabe für die nicht optimierte Version des Programms "
|
|
Packit |
1470ea |
"<app>Swell Foop</app>."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:52
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"The image above shows a typical postscript output from <app>Massif</app>. This "
|
|
Packit |
1470ea |
"is the result you would get from playing a single game of <app>Swell Foop</app> "
|
|
Packit |
1470ea |
"(version 2.8.0) and then quitting. The postscript file will have a name like "
|
|
Packit |
1470ea |
"<file>massif.12345.ps</file> and the text file will be called "
|
|
Packit |
1470ea |
"<file>massif.12345.txt</file>. The number in the middle is the process ID of "
|
|
Packit |
1470ea |
"the program that was examined. If you actually try this example you will find "
|
|
Packit |
1470ea |
"two versions of each file, with slightly different numbers, this is because "
|
|
Packit |
1470ea |
"<app>Swell Foop</app> starts a second process and <app>Massif</app> follows "
|
|
Packit |
1470ea |
"that too. We will ignore this second process, it consumes very little memory."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Das Bild oben zeigt eine typische PostScript-Ausgabe von <app>Massif</app>. "
|
|
Packit |
1470ea |
"Dies ist das Ergebnis, wenn Sie eine einzige Runde <app>Swell Foop</app> "
|
|
Packit |
1470ea |
"(Version 2.8.0) spielen und dann die Anwendung schließen. Die PostScript-Datei "
|
|
Packit |
1470ea |
"hat einen Namen ähnlich wie <file>massif.12345.ps</file> und die Text-Datei "
|
|
Packit |
1470ea |
"<file>massif.12345.txt</file>. Die Zahl im Dateinamen entspricht der "
|
|
Packit |
1470ea |
"Prozesskennung des untersuchten Programms. Wenn Sie dieses Beispiel "
|
|
Packit |
1470ea |
"nachstellen, so werden Sie zwei Versionen jeder Datei mit leicht verschiedenen "
|
|
Packit |
1470ea |
"Nummern finden. Dies liegt daran, dass <app>Swell Foop</app> einen zweiten "
|
|
Packit |
1470ea |
"Prozess startet und <app>Massif</app> diesen ebenfalls protokolliert. Wie "
|
|
Packit |
1470ea |
"werden diesen zweiten Prozess ignorieren. Er verbraucht nur sehr wenig Speicher."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:66
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"At the top of the graph we see a large yellow band labelled gdk_pixbuf_new. "
|
|
Packit |
1470ea |
"This seems like an ideal candidate for optimization, but we will need to use "
|
|
Packit |
1470ea |
"the text file to find out what is calling gdk_pixbuf_new. The top of the text "
|
|
Packit |
1470ea |
"file will look something like this:"
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Oben in der Grafik sehen Sie ein großes gelbes Band mit der Bezeichnung "
|
|
Packit |
1470ea |
"gdk_pixbuf_new. Dies schaut nach einem idealen Kandidaten für "
|
|
Packit |
1470ea |
"Optimierungsversuche aus, aber wir werden die Textdatei verwenden müssen, um "
|
|
Packit |
1470ea |
"herauszufinden, wo gdk_pixbuf_new aufgerufen wird. Der Anfang der Textdatei "
|
|
Packit |
1470ea |
"sieht in etwa so aus:"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/code
|
|
Packit |
1470ea |
#: C/massif.page:69
|
|
Packit |
1470ea |
#, no-wrap
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"Command: ./swell-foop\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"== 0 ===========================\n"
|
|
Packit |
1470ea |
"Heap allocation functions accounted for 90.4% of measured spacetime\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"Called from:\n"
|
|
Packit |
1470ea |
" 28.8% : 0x6BF83A: gdk_pixbuf_new (in /usr/lib/libgdk_pixbuf-2.0.so.0.400.9)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 6.1% : 0x5A32A5: g_strdup (in /usr/lib/libglib-2.0.so.0.400.6)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 5.9% : 0x510B3C: (within /usr/lib/libfreetype.so.6.3.7)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 3.5% : 0x2A4A6B: __gconv_open (in /lib/tls/libc-2.3.3.so)\n"
|
|
Packit |
1470ea |
" "
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"Command: ./swell-foop\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"== 0 ===========================\n"
|
|
Packit |
1470ea |
"Heap allocation functions accounted for 90.4% of measured spacetime\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"Called from:\n"
|
|
Packit |
1470ea |
" 28.8% : 0x6BF83A: gdk_pixbuf_new (in /usr/lib/libgdk_pixbuf-2.0.so.0.400.9)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 6.1% : 0x5A32A5: g_strdup (in /usr/lib/libglib-2.0.so.0.400.6)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 5.9% : 0x510B3C: (within /usr/lib/libfreetype.so.6.3.7)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 3.5% : 0x2A4A6B: __gconv_open (in /lib/tls/libc-2.3.3.so)\n"
|
|
Packit |
1470ea |
" "
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:84
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"The line with the '=' signs indicates how far down the stack trace we are, in "
|
|
Packit |
1470ea |
"this case we are at the top. After this it lists the heaviest users of memory "
|
|
Packit |
1470ea |
"in order of decreasing spacetime. Spacetime is the product of the amount of "
|
|
Packit |
1470ea |
"memory used and how long it was used for. It corresponds to the area of the "
|
|
Packit |
1470ea |
"bands in the graph. This part of the file tells us what we already know: most "
|
|
Packit |
1470ea |
"of the spacetime is dedicated to gdk_pixbuf_new. To find out what called "
|
|
Packit |
1470ea |
"gdk_pixbuf_new we need to search further down the text file:"
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Die Zeile mit »=«-Zeichen deutet an, wie tief wir uns in der Stack-Trace "
|
|
Packit |
1470ea |
"befinden. In diesem Fall sind wir ganz oben. Danach werden die größten "
|
|
Packit |
1470ea |
"Speicherbeleger nach absteigender Raumzeit aufgeführt. Raumzeit ist das Produkt "
|
|
Packit |
1470ea |
"der Menge des belegten Speichers und wie lange er belegt wurde. Dies entspricht "
|
|
Packit |
1470ea |
"der Fläche der Bänder im Grafen. Dieser Teil der Datei belegt, was wir bereits "
|
|
Packit |
1470ea |
"wissen: der Großteil der Raumzeit ist gdk_pixbuf_new gewidmet. Um "
|
|
Packit |
1470ea |
"herauszufinden, was gdk_pixbuf_new aufrief, müssen wir weiter unten in der "
|
|
Packit |
1470ea |
"Textdatei suchen:"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/code
|
|
Packit |
1470ea |
#: C/massif.page:87
|
|
Packit |
1470ea |
#, no-wrap
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"== 4 ===========================\n"
|
|
Packit |
1470ea |
"Context accounted for 28.8% of measured spacetime\n"
|
|
Packit |
1470ea |
" 0x6BF83A: gdk_pixbuf_new (in /usr/lib/libgdk_pixbuf-2.0.so.0.400.9)\n"
|
|
Packit |
1470ea |
" 0x3A998998: (within /usr/lib/gtk-2.0/2.4.0/loaders/libpixbufloader-png.so)\n"
|
|
Packit |
1470ea |
" 0x6C2760: (within /usr/lib/libgdk_pixbuf-2.0.so.0.400.9)\n"
|
|
Packit |
1470ea |
" 0x6C285E: gdk_pixbuf_new_from_file (in /usr/lib/libgdk_pixbuf-2.0.so.0.400.9)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"Called from:\n"
|
|
Packit |
1470ea |
" 27.8% : 0x804C1A3: load_scenario (swell-foop.c:463)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 0.9% : 0x3E8095E: (within /usr/lib/libgnomeui-2.so.0.792.0)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" and 1 other insignificant place\n"
|
|
Packit |
1470ea |
" "
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"== 4 ===========================\n"
|
|
Packit |
1470ea |
"Context accounted for 28.8% of measured spacetime\n"
|
|
Packit |
1470ea |
" 0x6BF83A: gdk_pixbuf_new (in /usr/lib/libgdk_pixbuf-2.0.so.0.400.9)\n"
|
|
Packit |
1470ea |
" 0x3A998998: (within /usr/lib/gtk-2.0/2.4.0/loaders/libpixbufloader-png.so)\n"
|
|
Packit |
1470ea |
" 0x6C2760: (within /usr/lib/libgdk_pixbuf-2.0.so.0.400.9)\n"
|
|
Packit |
1470ea |
" 0x6C285E: gdk_pixbuf_new_from_file (in /usr/lib/libgdk_pixbuf-2.0.so.0.400.9)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"Called from:\n"
|
|
Packit |
1470ea |
" 27.8% : 0x804C1A3: load_scenario (swell-foop.c:463)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 0.9% : 0x3E8095E: (within /usr/lib/libgnomeui-2.so.0.792.0)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" and 1 other insignificant place\n"
|
|
Packit |
1470ea |
" "
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:102
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"The first line tells us we are now four levels deep into the stack. Below it is "
|
|
Packit |
1470ea |
"a listing of the function calls that leads from here to gdk_pixbuf_new. Finally "
|
|
Packit |
1470ea |
"there is a list of functions that are at the next level down and call these "
|
|
Packit |
1470ea |
"functions. There are, of course, also entries for levels 1, 2, and 3, but this "
|
|
Packit |
1470ea |
"is the first level to reach right down through the GDK code to the <app>Swell "
|
|
Packit |
1470ea |
"Foop</app> code. From this listing, we can see instantly that the problem code "
|
|
Packit |
1470ea |
"is load_scenario."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Die erste Zeile besagt, dass wir uns nun vier Ebenen tief im Stapelspeicher "
|
|
Packit |
1470ea |
"befinden. Darunter ist eine Auflistung der Funktionsaufrufe, die von hier bis "
|
|
Packit |
1470ea |
"gdk_pixbuf_new reichen. Schließlich findet sich eine Liste von Funktionen, die "
|
|
Packit |
1470ea |
"sich eine Ebene darunter befinden und jene Funktionen aufrufen. es gibt "
|
|
Packit |
1470ea |
"natürlich auch Einträge für die Ebenen 1 bis 3, aber dies ist die erste Ebene, "
|
|
Packit |
1470ea |
"die man über den GDK-Code bis zum <app>Swell Foop</app>-Code erreichen kann. "
|
|
Packit |
1470ea |
"Aus der Auflistung kann man sofort erkennen, dass der problematische Code in "
|
|
Packit |
1470ea |
"load_scenario ist."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:105
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Now that we know what part of our code is using all the spacetime we can look "
|
|
Packit |
1470ea |
"at it and find out why. It turns out that the load_scenario is loading a pixbuf "
|
|
Packit |
1470ea |
"from file and then never freeing that memory. Having identified the problem "
|
|
Packit |
1470ea |
"code, we can start to fix it."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Jetzt, wo wir wissen, welcher Teil unseres Codes alle Raumzeit belegt, können "
|
|
Packit |
1470ea |
"wir ihn betrachten und die Ursache herausfinden. Es stellt sich heraus, dass "
|
|
Packit |
1470ea |
"load_scenario einen Pixbuf aus einer Datei lädt und diesen Speicher nie mehr "
|
|
Packit |
1470ea |
"frei gibt. Nachdem das Problem identifiziert wurde, können wir es beheben."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/title
|
|
Packit |
1470ea |
#: C/massif.page:110
|
|
Packit |
1470ea |
msgid "Acting on the Results"
|
|
Packit |
1470ea |
msgstr "Aufgrund der Ergebnisse handeln"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:111
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Reducing spacetime consumption is good, but there are two ways of reducing it "
|
|
Packit |
1470ea |
"and they are not equal. You can either reduce the amount of memory allocated, "
|
|
Packit |
1470ea |
"or reduce the amount of time it is allocated for. Consider for a moment a model "
|
|
Packit |
1470ea |
"system with only two processes running. Both processes use up almost all the "
|
|
Packit |
1470ea |
"physical RAM and if they overlap at all then the system will swap and "
|
|
Packit |
1470ea |
"everything will slow down. Obviously if we reduce the memory usage of each "
|
|
Packit |
1470ea |
"process by a factor of two then they can peacefully coexist without the need "
|
|
Packit |
1470ea |
"for swapping. If instead we reduce the time the memory is allocated by a factor "
|
|
Packit |
1470ea |
"of two then the two programs can coexist, but only as long as their periods of "
|
|
Packit |
1470ea |
"high memory use don't overlap. So it is better to reduce the amount of memory "
|
|
Packit |
1470ea |
"allocated."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Ein Reduzieren des Verbrauches an Raumzeit ist gut, aber es gibt zwei "
|
|
Packit |
1470ea |
"verschiedene Wege, dies zu tun. Sie können entweder die angeforderte "
|
|
Packit |
1470ea |
"Speichermenge oder die Belegungszeit reduzieren. Betrachten Sie für einen "
|
|
Packit |
1470ea |
"Moment ein Modellsystem mit nur zwei laufenden Prozessen. Beide Prozesse "
|
|
Packit |
1470ea |
"belegen fast allen physikalischen Arbeitsspeicher und sobald sie sich "
|
|
Packit |
1470ea |
"überlappen, wird das System auslagern müssen und es wird sehr langsam. Es ist "
|
|
Packit |
1470ea |
"offensichtlich, dass die beiden Prozesse friedlich nebeneinander existieren "
|
|
Packit |
1470ea |
"können, wenn wir den Speicherverbrauch jedes Prozesses halbieren. Wenn wir "
|
|
Packit |
1470ea |
"statt dessen die Speicherbelegungszeit halbieren, dann können die beiden "
|
|
Packit |
1470ea |
"Prozesse nebeneinander existieren, aber nur solange ihre Zeiträume hoher "
|
|
Packit |
1470ea |
"Speicherbelegung nicht überlappen. Demnach ist es besser, die Speicherbelegung "
|
|
Packit |
1470ea |
"zu reduzieren."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:114
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Unfortunately, the choice of optimization is also constrained by the needs of "
|
|
Packit |
1470ea |
"the program. The size of the pixbuf data in <app>Swell Foop</app> is determined "
|
|
Packit |
1470ea |
"by the size of the game's graphics and cannot be easily reduced. However, the "
|
|
Packit |
1470ea |
"amount of time it spends loaded into memory can be drastically reduced. The "
|
|
Packit |
1470ea |
"image below shows the <app>Massif</app> analysis of <app>Swell Foop</app> after "
|
|
Packit |
1470ea |
"being altered to dispose of the pixbufs once the images have been loaded into "
|
|
Packit |
1470ea |
"the X server."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Unglücklicherweise schränken die Erfordernisse des Programms die Wahl der "
|
|
Packit |
1470ea |
"Optimierung ein. Die Größe der Pixbuf-Daten in <app>Swell Foop</app> ist von "
|
|
Packit |
1470ea |
"der Größe der Grafiken im Spiel abhängig und kann nicht ohne Weiteres reduziert "
|
|
Packit |
1470ea |
"werden. Allerdings kann die Zeit zum Laden des Programms in den Speicher "
|
|
Packit |
1470ea |
"drastisch reduziert werden! Das Bild unten zeigt die <app>Massif</app>-Analyse "
|
|
Packit |
1470ea |
"von <app>Swell Foop</app> nach den Änderungen, die die Pixbufs entsorgen, "
|
|
Packit |
1470ea |
"sobald diese vom X-Server geladen wurden."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: figure/title
|
|
Packit |
1470ea |
#: C/massif.page:123
|
|
Packit |
1470ea |
msgid "<app>Massif</app> output for the optimized <app>Swell Foop</app> program."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"<app>Massif</app>-Ausgaben für das optimierte Programm <app>Swell Foop</app>."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:126
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"The spacetime use of gdk_pixbuf_new is now a thin band that only spikes briefly "
|
|
Packit |
1470ea |
"(it is now the sixteenth band down and shaded magenta). As a bonus, the peak "
|
|
Packit |
1470ea |
"memory use has dropped by 200 kB since the spike occurs before other memory is "
|
|
Packit |
1470ea |
"allocated. If two processes like this were run together the chances of the peak "
|
|
Packit |
1470ea |
"memory usage coinciding, and hence the risk of swapping, would be quite low."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Die Raumzeit-Belegung von gdk_pixbuf_new ist nun nur noch ein dünnes Band, das "
|
|
Packit |
1470ea |
"nur kurzzeitig einen Spitzenwert hat (es ist nun das sechzehnte schraffierte "
|
|
Packit |
1470ea |
"magenta Band von oben). Als Bonus ist der Spitzenspeicherverbrauch um 200 kB "
|
|
Packit |
1470ea |
"gesunken, weil die Spitze vor anderen Speicheranforderungen liegt. Wenn zwei "
|
|
Packit |
1470ea |
"solche Prozesse zeitgleich liefen, wäre die Wahrscheinlichkeit ziemlich gering, "
|
|
Packit |
1470ea |
"dass der höchste Speicherverbrauch beider zusammen fällt."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:129
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Can we do better ? A quick examination of <app>Massif</app>'s text output "
|
|
Packit |
1470ea |
"reveals: g_strdup to be the new major offender."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Können wir noch zulegen? Eine schnelle Untersuchung der Textausgabe von "
|
|
Packit |
1470ea |
"<app>Massif</app> enthüllt: g_strdup ist der neue Hauptschuldige."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/code
|
|
Packit |
1470ea |
#: C/massif.page:132
|
|
Packit |
1470ea |
#, no-wrap
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"Command: ./swell-foop\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"== 0 ===========================\n"
|
|
Packit |
1470ea |
"Heap allocation functions accounted for 87.6% of measured spacetime\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"Called from:\n"
|
|
Packit |
1470ea |
" 7.7% : 0x5A32A5: g_strdup (in /usr/lib/libglib-2.0.so.0.400.6)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 7.6% : 0x43BC9F: (within /usr/lib/libgdk-x11-2.0.so.0.400.9)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 6.9% : 0x510B3C: (within /usr/lib/libfreetype.so.6.3.7)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 5.2% : 0x2A4A6B: __gconv_open (in /lib/tls/libc-2.3.3.so)\n"
|
|
Packit |
1470ea |
" "
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"Command: ./swell-foop\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"== 0 ===========================\n"
|
|
Packit |
1470ea |
"Heap allocation functions accounted for 87.6% of measured spacetime\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"Called from:\n"
|
|
Packit |
1470ea |
" 7.7% : 0x5A32A5: g_strdup (in /usr/lib/libglib-2.0.so.0.400.6)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 7.6% : 0x43BC9F: (within /usr/lib/libgdk-x11-2.0.so.0.400.9)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 6.9% : 0x510B3C: (within /usr/lib/libfreetype.so.6.3.7)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 5.2% : 0x2A4A6B: __gconv_open (in /lib/tls/libc-2.3.3.so)\n"
|
|
Packit |
1470ea |
" "
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:147
|
|
Packit |
1470ea |
msgid "If we look closer though we see that it is called from many, many, places."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Bei näherer Betrachtung sehen wir jedoch, dass es von vielen verschiedenen "
|
|
Packit |
1470ea |
"Orten aus aufgerufen wird."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/code
|
|
Packit |
1470ea |
#: C/massif.page:150
|
|
Packit |
1470ea |
#, no-wrap
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"== 1 ===========================\n"
|
|
Packit |
1470ea |
"Context accounted for 7.7% of measured spacetime\n"
|
|
Packit |
1470ea |
" 0x5A32A5: g_strdup (in /usr/lib/libglib-2.0.so.0.400.6)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"Called from:\n"
|
|
Packit |
1470ea |
" 1.8% : 0x8BF606: gtk_icon_source_copy (in /usr/lib/libgtk-x11-2.0.so.0.400.9)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 1.1% : 0x67AF6B: g_param_spec_internal (in /usr/lib/libgobject-2.0.so.0.400.6)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 0.9% : 0x91FCFC: (within /usr/lib/libgtk-x11-2.0.so.0.400.9)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 0.8% : 0x57EEBF: g_quark_from_string (in /usr/lib/libglib-2.0.so.0.400.6)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" and 155 other insignificant places\n"
|
|
Packit |
1470ea |
" "
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"== 1 ===========================\n"
|
|
Packit |
1470ea |
"Context accounted for 7.7% of measured spacetime\n"
|
|
Packit |
1470ea |
" 0x5A32A5: g_strdup (in /usr/lib/libglib-2.0.so.0.400.6)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
"Called from:\n"
|
|
Packit |
1470ea |
" 1.8% : 0x8BF606: gtk_icon_source_copy (in /usr/lib/libgtk-x11-2.0.so.0.400.9)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 1.1% : 0x67AF6B: g_param_spec_internal (in /usr/lib/libgobject-2.0.so.0.400.6)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 0.9% : 0x91FCFC: (within /usr/lib/libgtk-x11-2.0.so.0.400.9)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" 0.8% : 0x57EEBF: g_quark_from_string (in /usr/lib/libglib-2.0.so.0.400.6)\n"
|
|
Packit |
1470ea |
"\n"
|
|
Packit |
1470ea |
" and 155 other insignificant places\n"
|
|
Packit |
1470ea |
" "
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:166
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"We now face diminishing returns for our optimization efforts. The graph hints "
|
|
Packit |
1470ea |
"at another possible approach: Both the \"other\" and \"heap admin\" bands are "
|
|
Packit |
1470ea |
"quite large. This tells us that there are a lot of small allocations being made "
|
|
Packit |
1470ea |
"from a variety of places. Eliminating these will be difficult, but if they can "
|
|
Packit |
1470ea |
"be grouped then the individual allocations can be larger and the \"heap admin\" "
|
|
Packit |
1470ea |
"overhead can be reduced."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Nun begegnen wir geschmälerten Resultaten für unsere Bemühungen. Der Graph "
|
|
Packit |
1470ea |
"deutet einen weiteren möglichen Schritt an: Die Bänder »other« und »heap admin« "
|
|
Packit |
1470ea |
"sind beide ziemlich groß. Dies besagt, dass eine Vielzahl kleiner Anforderungen "
|
|
Packit |
1470ea |
"an vielen Orten gemacht werden. Jene zu eliminieren ist schwierig, aber wenn "
|
|
Packit |
1470ea |
"sie zusammen gelegt werden, dann werden die einzelnen Anforderungen größer und "
|
|
Packit |
1470ea |
"der Verwaltungsaufwand (»heap admin«) kann reduziert werden."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/title
|
|
Packit |
1470ea |
#: C/massif.page:171
|
|
Packit |
1470ea |
msgid "Caveats"
|
|
Packit |
1470ea |
msgstr "Vorbehalte"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:172
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"There are a couple of things to watch out for: Firstly, spacetime is only "
|
|
Packit |
1470ea |
"reported as a percentage, you have to compare it to the overall size of the "
|
|
Packit |
1470ea |
"program to decide if the amount of memory is worth pursuing. The graph, with "
|
|
Packit |
1470ea |
"its kilobyte vertical axis, is good for this."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Es gibt ein paar Dinge, auf die man achten muss. Erstens: Raumzeit wird nur als "
|
|
Packit |
1470ea |
"Prozentangabe geliefert. Sie müssen mit der Gesamtgröße des Programms "
|
|
Packit |
1470ea |
"vergleichen, um festzustellen, ob es sich lohnt, diese Speichermenge anzugehen. "
|
|
Packit |
1470ea |
"Der Graph mit der vertikalen Achse in Kilobytes eignet sich gut dafür."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. (itstool) path: section/p
|
|
Packit |
1470ea |
#: C/massif.page:175
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Secondly, <app>Massif</app> only takes into account the memory used by your own "
|
|
Packit |
1470ea |
"program. Resources like pixmaps are stored in the X server and aren't "
|
|
Packit |
1470ea |
"considered by <app>Massif</app>. In the <app>Swell Foop</app> example we have "
|
|
Packit |
1470ea |
"actually only moved the memory consumption from client-side pixbufs to server-"
|
|
Packit |
1470ea |
"side pixmaps. Even though we cheated there are performance gains. Keeping the "
|
|
Packit |
1470ea |
"image data in the X server makes the graphics routines quicker and removes a "
|
|
Packit |
1470ea |
"lot of inter-process communication. Also, the pixmaps will be stored in a "
|
|
Packit |
1470ea |
"native graphics format which is often more compact than the 32-bit RGBA format "
|
|
Packit |
1470ea |
"used by gdk_pixbuf. To measure the effect of pixmaps, and other X resources use "
|
|
Packit |
1470ea |
"the <link href=\"http://www.freedesktop.org/Software/xrestop\">xrestop</link> "
|
|
Packit |
1470ea |
"program."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Zweitens: <app>Massif</app> erfasst nur die Speicherbelegung durch Ihr eigenes "
|
|
Packit |
1470ea |
"Programm. Ressourcen wie Pixmaps werden im X-Server gespeichert und werden "
|
|
Packit |
1470ea |
"nicht durch <app>Massif</app> berücksichtigt. In dem Beispiel mit <app>Swell "
|
|
Packit |
1470ea |
"Foop</app> haben wir tatsächlich nur den Speicherverbrauch von client-seitigen "
|
|
Packit |
1470ea |
"Pixbufs zu server-seitigen Pixmaps verlagert. Obwohl dies nur nach Schummeln "
|
|
Packit |
1470ea |
"aussieht, gab es dennoch Geschwindigkeitsgewinne. Bilddaten im X-Server "
|
|
Packit |
1470ea |
"beschleunigen die Grafik-Routinen und verhindert viele Inter-Prozess-"
|
|
Packit |
1470ea |
"Kommunikation. Ebenso werden die Pixmaps in nativem Grafikformat gespeichert, "
|
|
Packit |
1470ea |
"welches oft kompakter ist als das 32-bit RGBA-Format von gdk_pixbuf. Um den "
|
|
Packit |
1470ea |
"Effekt von Pixmaps und anderen Ressourcen des X-Servers zu messen, sollten Sie "
|
|
Packit |
1470ea |
"das Programm
|
|
Packit |
1470ea |
"\">xrestop</link> verwenden."
|
|
Packit |
1470ea |
|