|
Packit |
1470ea |
# Galician translation for gnome-devel-docs.
|
|
Packit |
1470ea |
# Copyright (C) 2011 gnome-devel-docs's COPYRIGHT HOLDER
|
|
Packit |
1470ea |
# This file is distributed under the same license as the gnome-devel-docs package.
|
|
Packit |
1470ea |
# Fran Dieguez <frandieguez@gnome.org>, 2011, 2012, 2013.
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Project-Id-Version: gnome-devel-docs master\n"
|
|
Packit |
1470ea |
"POT-Creation-Date: 2012-10-31 14:51+0000\n"
|
|
Packit |
1470ea |
"PO-Revision-Date: 2013-03-27 13:43+0200\n"
|
|
Packit |
1470ea |
"Last-Translator: Fran Dieguez <frandieguez@gnome.org>\n"
|
|
Packit |
1470ea |
"Language-Team: gnome-l10n-gl@gnome.org\n"
|
|
Packit |
1470ea |
"Language: gl\n"
|
|
Packit |
1470ea |
"MIME-Version: 1.0\n"
|
|
Packit |
1470ea |
"Content-Type: text/plain; charset=UTF-8\n"
|
|
Packit |
1470ea |
"Content-Transfer-Encoding: 8bits\n"
|
|
Packit |
1470ea |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
Packit |
1470ea |
"X-Generator: Virtaal 0.7.1\n"
|
|
Packit |
1470ea |
"X-Project-Style: gnome\n"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#. Put one translator per line, in the form NAME <EMAIL>, YEAR1, YEAR2
|
|
Packit |
1470ea |
#| msgid "translator-credits"
|
|
Packit |
1470ea |
msgctxt "_"
|
|
Packit |
1470ea |
msgid "translator-credits"
|
|
Packit |
1470ea |
msgstr "Fran Dieguez <frandieguez@gnome.org>, 2011-2013."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/index.docbook:5(book/title)
|
|
Packit |
1470ea |
msgid "Optimizing GNOME Software"
|
|
Packit |
1470ea |
msgstr "Optimizar software para GNOME"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/index.docbook:8(publisher/publishername)
|
|
Packit |
1470ea |
#: C/index.docbook:56(revdescription/para)
|
|
Packit |
1470ea |
msgid "GNOME Documentation Project"
|
|
Packit |
1470ea |
msgstr "GNOME Documentation Project"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/index.docbook:10(bookinfo/copyright)
|
|
Packit |
1470ea |
msgid "<year>2004-2005</year> <holder>Callum McKenzie</holder>"
|
|
Packit |
1470ea |
msgstr "<year>2004-2005</year> <holder>Callum McKenzie</holder>"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/index.docbook:14(bookinfo/copyright)
|
|
Packit |
1470ea |
msgid "<year>2004-2005</year> <holder>Robert Love</holder>"
|
|
Packit |
1470ea |
msgstr "<year>2004-2005</year> <holder>Robert Love</holder>"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/index.docbook:19(bookinfo/author)
|
|
Packit |
1470ea |
msgid "<firstname>Callum</firstname> <surname>McKenzie</surname>"
|
|
Packit |
1470ea |
msgstr "<firstname>Callum</firstname> <surname>McKenzie</surname>"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/index.docbook:23(bookinfo/author)
|
|
Packit |
1470ea |
msgid "<firstname>Robert</firstname> <surname>Love</surname>"
|
|
Packit |
1470ea |
msgstr "<firstname>Robert</firstname> <surname>Love</surname>"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/index.docbook:29(legalnotice/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Permission is granted to copy, distribute and/or modify this document under "
|
|
Packit |
1470ea |
"the terms of the <citetitle>GNU Free Documentation License</citetitle>, "
|
|
Packit |
1470ea |
"Version 1.1 or any later version published by the Free Software Foundation "
|
|
Packit |
1470ea |
"with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. "
|
|
Packit |
1470ea |
"You may obtain a copy of the <citetitle>GNU Free Documentation License</"
|
|
Packit |
1470ea |
"citetitle> from the Free Software Foundation by visiting
|
|
Packit |
1470ea |
"\" url=\"http://www.fsf.org\">their Web site</ulink> or by writing to: Free "
|
|
Packit |
1470ea |
"Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA "
|
|
Packit |
1470ea |
"02111-1307, USA."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Concédese o permiso para copiar, distribuír e/ou modificar este documento "
|
|
Packit |
1470ea |
"baixo os termos da <citetitle>Licenza de documentación libre de "
|
|
Packit |
1470ea |
"GNU</citetitle>, versión 1.1 ou calquera versión publicada pola Free "
|
|
Packit |
1470ea |
"Software Foundation con seccións invariantes, sen textos de portada e sen "
|
|
Packit |
1470ea |
"textos de portada traseira. Pode obter unha copia da <citetitle>Licenza de "
|
|
Packit |
1470ea |
"documentación libre de GNU</citetitle> da Free Software Foundation visitando "
|
|
Packit |
1470ea |
"<ulink type=\"http\" url=\"http://www.fsf.org\">a súa páxina web</ulink> ou "
|
|
Packit |
1470ea |
"enviando unha carta a: Free Software Foundation, Inc., 59 Temple Place - "
|
|
Packit |
1470ea |
"Suite 330, Boston, MA 02111-1307, USA."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/index.docbook:41(legalnotice/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Many of the names used by companies to distinguish their products and "
|
|
Packit |
1470ea |
"services are claimed as trademarks. Where those names appear in any GNOME "
|
|
Packit |
1470ea |
"documentation, and those trademarks are made aware to the members of the "
|
|
Packit |
1470ea |
"GNOME Documentation Project, the names have been printed in caps or initial "
|
|
Packit |
1470ea |
"caps."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Moitos dos nomes usados por empresas para distinguir os seus produtos e "
|
|
Packit |
1470ea |
"servizos son marcas rexistradas. Cando aparezan ditos nomes na documentación "
|
|
Packit |
1470ea |
"de GNOME, e esas marcas rexistradas se lle mostren aos membros do Proxecto "
|
|
Packit |
1470ea |
"de Documentación de GNOME, os nomes son escritos en maiúsculas ou maiúscula "
|
|
Packit |
1470ea |
"inicial."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/index.docbook:55(revdescription/para)
|
|
Packit |
1470ea |
msgid "William Johnston"
|
|
Packit |
1470ea |
msgstr "William Johnston"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/index.docbook:57(revdescription/para)
|
|
Packit |
1470ea |
msgid "Intial conversion to docbook format."
|
|
Packit |
1470ea |
msgstr "Conversión inicial ao formato docbook."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/index.docbook:51(revhistory/revision)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"<revnumber>0.1</revnumber> <date>November 2007</date> <_:revdescription-1/>"
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"<revnumber>0.1</revnumber> <date>Novembro 2007</date> <_:revdescription-1/>"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/index.docbook:63(abstract/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Software can be optimized in many ways: for speed, program size, or memory "
|
|
Packit |
1470ea |
"use. This section contains guides and tutorials for optimizing your software."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"O software pode optimizarse de moitas formas: para maior velocidade, tamaño "
|
|
Packit |
1470ea |
"do programa ou uso de memoria. Esta sección contén guías e titoriais para "
|
|
Packit |
1470ea |
"optimizar o seu software."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-harmful.xml:3(chapter/title)
|
|
Packit |
1470ea |
msgid "Disk Seeks Considered Harmful"
|
|
Packit |
1470ea |
msgstr "Buscas de disco consideradas dañinas"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-harmful.xml:5(chapter/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Disk seeks are one of the most expensive operations you can possibly "
|
|
Packit |
1470ea |
"perform. You might not know this from looking at how many of them we "
|
|
Packit |
1470ea |
"perform, but trust me, they are. Consequently, please refrain from the "
|
|
Packit |
1470ea |
"following suboptimal behavior:"
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"As buscas de disco son unha das operacións máis caras que pode realizar. "
|
|
Packit |
1470ea |
"Pode que non saiba isto simplemente mirando cantas se realizan, pero crea "
|
|
Packit |
1470ea |
"que realmente o son. Por iso, evite os seguintes comportamentos:"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-harmful.xml:10(listitem/para)
|
|
Packit |
1470ea |
msgid "Placing lots of small files all over the disk."
|
|
Packit |
1470ea |
msgstr "Localizar montóns de pequenos ficheiros por todo o disco."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-harmful.xml:15(listitem/para)
|
|
Packit |
1470ea |
msgid "Opening, stating, and reading lots of files all over the disk"
|
|
Packit |
1470ea |
msgstr "Abrir, iniciar e ler montóns de ficheiros por todo o disco"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-harmful.xml:20(listitem/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Doing the above on files that are laid out at different times, so as to "
|
|
Packit |
1470ea |
"ensure that they are fragmented and cause even more seeking."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Realizar o anterior sobre ficheiros que se abren en diferentes momentos, "
|
|
Packit |
1470ea |
"para asegurarse de que están fragmentados e causan aínda máis buscas no "
|
|
Packit |
1470ea |
"disco."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-harmful.xml:25(listitem/para)
|
|
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 and cause even more seeking."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Realizar o seguinte sobre ficheiros que están en diferentes cartafoles, para "
|
|
Packit |
1470ea |
"asegurarse de que están en grupos de cilindros diferentes e poden causar "
|
|
Packit |
1470ea |
"incluso máis buscas."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-harmful.xml:30(listitem/para)
|
|
Packit |
1470ea |
msgid "Repeatedly doing the above when it only needs to be done once."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Realizar de forma repetida o anterior cando só se precisa realizar unha vez."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-harmful.xml:35(chapter/para)
|
|
Packit |
1470ea |
msgid "Ways in which you can optimize your code to be seek-friendly:"
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Formas nas que pode optimizar o seu código para que sexa amigábel á hora de "
|
|
Packit |
1470ea |
"facer buscas:"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-harmful.xml:40(listitem/para)
|
|
Packit |
1470ea |
msgid "Consolidate data into a single file."
|
|
Packit |
1470ea |
msgstr "Consolidar os datos nun só ficheiro."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-harmful.xml:45(listitem/para)
|
|
Packit |
1470ea |
msgid "Keep data together in the same directory."
|
|
Packit |
1470ea |
msgstr "Manter os datos xuntos no mesmo cartafol."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-harmful.xml:50(listitem/para)
|
|
Packit |
1470ea |
msgid "Cache data so as to not need to reread constantly."
|
|
Packit |
1470ea |
msgstr "Cachear os datos para non ter que volver a lelos constantemente."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-harmful.xml:55(listitem/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Share data so as not to have to reread it from disk when each application "
|
|
Packit |
1470ea |
"loads."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Compartir os datos para non ter que volver a lelos do disco cada vez que un "
|
|
Packit |
1470ea |
"aplicativo se carga."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-harmful.xml:60(listitem/para)
|
|
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 |
"Considerar cachear tódolos datos nun ficheiro binario único que está aliñado "
|
|
Packit |
1470ea |
"axeitadamente e pódse mapear."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-harmful.xml:65(chapter/para)
|
|
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 "
|
|
Packit |
1470ea |
"are asynchronous. This only compounds the problem, serializing each read, "
|
|
Packit |
1470ea |
"and contributing to program latency."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"O problema coas buscas nos discos complícase para as lecturas, que é "
|
|
Packit |
1470ea |
"desafortunadamente o que se busca. Lembre, as lecturas son xeralmente "
|
|
Packit |
1470ea |
"síncronas mentres que as escrituras son asíncronas. Isto só complica o "
|
|
Packit |
1470ea |
"problema, serializando cada lectura e contribuíndo á latencia do programa."
|
|
Packit |
1470ea |
|
|
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/optimization-massif.xml:52(imagedata)
|
|
Packit |
1470ea |
#| msgid ""
|
|
Packit |
1470ea |
#| "@@image: 'figures/massif-before.png'; md5=1a6b2ace548e6789ab8bfacb3727b345"
|
|
Packit |
1470ea |
msgctxt "_"
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"external ref='figures/massif-before.png' "
|
|
Packit |
1470ea |
"md5='1a6b2ace548e6789ab8bfacb3727b345'"
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"external ref='figures/massif-before.png' "
|
|
Packit |
1470ea |
"md5='1a6b2ace548e6789ab8bfacb3727b345'"
|
|
Packit |
1470ea |
|
|
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/optimization-massif.xml:114(imagedata)
|
|
Packit |
1470ea |
#| msgid ""
|
|
Packit |
1470ea |
#| "@@image: 'figures/massif-after.png'; md5=36d1b4ad7ab49b28b69ad3eabbaa7069"
|
|
Packit |
1470ea |
msgctxt "_"
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"external ref='figures/massif-after.png' "
|
|
Packit |
1470ea |
"md5='36d1b4ad7ab49b28b69ad3eabbaa7069'"
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"external ref='figures/massif-after.png' "
|
|
Packit |
1470ea |
"md5='36d1b4ad7ab49b28b69ad3eabbaa7069'"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:3(chapter/title)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Using <application>Massif</application> for Profiling Memory Use in GNOME "
|
|
Packit |
1470ea |
"Software"
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Usando <application>Massif</application> para perfila o uso de memoria en "
|
|
Packit |
1470ea |
"software de GNOME"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:5(chapter/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"This article describes how to use the <application>Massif</application> heap "
|
|
Packit |
1470ea |
"profiler with GNOME applications. We describe how to invoke, interpret, and "
|
|
Packit |
1470ea |
"act on the output of <application>Massif</application>. The "
|
|
Packit |
1470ea |
"<application>Swell Foop</application> game is used as an example."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Este artigo describe como usar o perfilador de pila <application>Massif</"
|
|
Packit |
1470ea |
"application> con aplicativos de GNOME. Describirémoslle como invocalo, "
|
|
Packit |
1470ea |
"interpretar e actual sobre a saída de <application>Massif</application>. "
|
|
Packit |
1470ea |
"Usaremos o xogo <application>Swell Foop</application> para este exemplo."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:10(sect1/title)
|
|
Packit |
1470ea |
msgid "Introduction"
|
|
Packit |
1470ea |
msgstr "Introdución"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:11(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"<application>Massif</application> is a member of the
|
|
Packit |
1470ea |
"url=\"http://valgrind.org/\">valgrind</ulink> suite of memory-profiling "
|
|
Packit |
1470ea |
"tools. Its purpose is to give a detailed view of dynamic memory usage during "
|
|
Packit |
1470ea |
"the lifetime of the program. Specifically it records the memory use of the "
|
|
Packit |
1470ea |
"heap and the stack."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"<application>Massif</application> é un membro da suite de ferramentas de "
|
|
Packit |
1470ea |
"perfilado de memoria
|
|
Packit |
1470ea |
"\">valgrind</ulink>. O seu propósito é darlle unha visualización detallada "
|
|
Packit |
1470ea |
"do uso da memoria dinámica durante o ciclo de vida dun programa. "
|
|
Packit |
1470ea |
"Específicamente garda a memoria usada no heap e na stack."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:14(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"The heap is the region of memory which is allocated with functions like "
|
|
Packit |
1470ea |
"malloc. It grows on demand and is usually the largest region of memory in a "
|
|
Packit |
1470ea |
"program. The stack is where all the local data for functions is stored. This "
|
|
Packit |
1470ea |
"includes the \"automatic\" variables in C and the return address for "
|
|
Packit |
1470ea |
"subroutines. The stack is typically a lot smaller and a lot more active than "
|
|
Packit |
1470ea |
"the heap. We won't consider the stack explicitly since <application>Massif</"
|
|
Packit |
1470ea |
"application> treats it as though it were just another part of the heap. "
|
|
Packit |
1470ea |
"<application>Massif</application> also gives information about how much "
|
|
Packit |
1470ea |
"memory is used to manage the heap."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"A pila é a rexión da memoria que está reservada para funcións como malloc. "
|
|
Packit |
1470ea |
"Crece baixo demanda e é normalmente a rexión máis grande da memoria nun "
|
|
Packit |
1470ea |
"programa. A rima é onde se gardan os datos locais para as funcións. Isto "
|
|
Packit |
1470ea |
"inclúe as variábeis «automáticas» en C e o enderezo de devolución das "
|
|
Packit |
1470ea |
"subrutinas. A rima normalmente é moito máis pequena e máis activa que a "
|
|
Packit |
1470ea |
"pila. Non consideramos a pila explicitamente xa que <application>Massif</"
|
|
Packit |
1470ea |
"application> trátaa como se fora outra parte da rima. <application>Massif</"
|
|
Packit |
1470ea |
"application> tamén lle fornece información sobre canta memoria se usa para "
|
|
Packit |
1470ea |
"xestionar a pila."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:17(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"<application>Massif</application> produces two output files: a graphical "
|
|
Packit |
1470ea |
"overview in a postscript file and a detailed breakdown in a text file."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"<application>Massif</application> produce dous ficheiros de saída: unha "
|
|
Packit |
1470ea |
"vista gráfica xeral nun ficheiro postscript e unha explicación detallada nun "
|
|
Packit |
1470ea |
"ficheiro de texto."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:22(sect1/title)
|
|
Packit |
1470ea |
msgid "Using <application>Massif</application> with GNOME"
|
|
Packit |
1470ea |
msgstr "Usar <application>Massif</application> con GNOME"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:23(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"<application>Massif</application> has very few options and for many programs "
|
|
Packit |
1470ea |
"does not need them. However for GNOME applications, where memory allocation "
|
|
Packit |
1470ea |
"might be buried deep in either glib or GTK, the number of levels down the "
|
|
Packit |
1470ea |
"call-stack Massif descends needs to be increased. This is achieved using the "
|
|
Packit |
1470ea |
"--depth parameter. By default this is 3; increasing it to 5 will guarantee "
|
|
Packit |
1470ea |
"the call-stack reaches down to your code. One or two more levels may also be "
|
|
Packit |
1470ea |
"desirable to provide your code with some context. Since the level of detail "
|
|
Packit |
1470ea |
"becomes quickly overwhelming it is best to start with the smaller depth "
|
|
Packit |
1470ea |
"parameter and only increase it when it becomes apparent that it isn't "
|
|
Packit |
1470ea |
"sufficient."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"<application>Massif</application> ten varias opcións e algúns programas non "
|
|
Packit |
1470ea |
"as precisan. Porén para os aplicativos GNOME, a medida que baixa nos niveles "
|
|
Packit |
1470ea |
"da pila de chamadas os descendentes de Massif deben incrementarse. Isto "
|
|
Packit |
1470ea |
"pódese facer empregando o parámetro --depth. Por omisión isto é 3; "
|
|
Packit |
1470ea |
"incrementándoa a 5 garantizaralle que a pila de chamadas alcanza o seu "
|
|
Packit |
1470ea |
"código. Un ou máis niveles poden ser desexabeis para fornecerlle algún "
|
|
Packit |
1470ea |
"contexto ao seu código. Xa que o nivel de detalles pode ser moi rapidamente "
|
|
Packit |
1470ea |
"inxestionábel é mellor comezar con un valor de profundidade menos profundo e "
|
|
Packit |
1470ea |
"só incrementalo cando aparentemente non sexa dabondo."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:26(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"It is also useful to tell <application>Massif</application> which functions "
|
|
Packit |
1470ea |
"allocate memory in glib. It removes an unnecessary layer of function calls "
|
|
Packit |
1470ea |
"from the reports and gives you a clearer idea of what code is allocating "
|
|
Packit |
1470ea |
"memory. The allocating functions in glib are g_malloc, g_malloc0, g_realloc, "
|
|
Packit |
1470ea |
"g_try_malloc, and g_mem_chunk_alloc. You use the --alloc-fn option to tell "
|
|
Packit |
1470ea |
"Massif about them."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Tamén é útil dicirlle a <application>Massif</application> que funcións "
|
|
Packit |
1470ea |
"reservan memoria en glib. Elimina unha capa non necesaria das chamadas das "
|
|
Packit |
1470ea |
"funcións desde os informes e fornécelle unha idea clara de que código está "
|
|
Packit |
1470ea |
"reservando memoria. As funcións de reserva en glib son g_malloc, g_malloc0, "
|
|
Packit |
1470ea |
"g_realloc, g_try_malloc e g_mem_chunk_alloc. Usará a opción --alloc-fn para "
|
|
Packit |
1470ea |
"dicirlle a Massif sobre elas."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:29(sect1/para)
|
|
Packit |
1470ea |
msgid "Your command-line should therefore look something like:"
|
|
Packit |
1470ea |
msgstr "A súa liña de orde debería semellarse a esta:"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:32(sect1/programlisting)
|
|
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 |
#: C/optimization-massif.xml:36(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"<application>Swell Foop</application> is the program we will be using as an "
|
|
Packit |
1470ea |
"example. Be warned that, since valgrind emulates the CPU, it will run "
|
|
Packit |
1470ea |
"<emphasis>very</emphasis> slowly. You will also need a lot of memory."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"<application>Swell Foop</application> é o programa que usaremos como "
|
|
Packit |
1470ea |
"exemplo. Teña en conta isto, xa que valgrind emula o CPU, executarase "
|
|
Packit |
1470ea |
"<emphasis>moi</emphasis> lento. E tamén precisara moita memoria."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:41(sect1/title)
|
|
Packit |
1470ea |
msgid "Interpreting the Results"
|
|
Packit |
1470ea |
msgstr "Interpretar os resultados"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:42(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"The graphical output of <application>Massif</application> is largely self "
|
|
Packit |
1470ea |
"explanatory. Each band represents the memory allocated by one function over "
|
|
Packit |
1470ea |
"time. Once you identify which bands are using the most memory, usually the "
|
|
Packit |
1470ea |
"big thick ones at the top you will have to consult the text file for the "
|
|
Packit |
1470ea |
"details."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"A saída gráfica de <application>Massif</application> é moi autoexplicativa. "
|
|
Packit |
1470ea |
"Cada banda representa a memoria asignada a unha función ao longo do tempo. "
|
|
Packit |
1470ea |
"Cando teña identificada que bandas están usando a maioría da memoria, "
|
|
Packit |
1470ea |
"normalmente a máis ancha estará na parte superior polo que terá que "
|
|
Packit |
1470ea |
"consultar o ficheiro de texto para obter máis detalles."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:45(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"The text file is arranged as a hierarchy of sections, at the top is a list "
|
|
Packit |
1470ea |
"of the worst memory users arranged in order of decreasing spacetime. Below "
|
|
Packit |
1470ea |
"this are further sections, each breaking the results down into finer detail "
|
|
Packit |
1470ea |
"as you proceed down the call-stack. To illustrate this we will use the "
|
|
Packit |
1470ea |
"output of the command above."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"O ficheiro de texto está ordenado como unha xerarquía por seccións, na parte "
|
|
Packit |
1470ea |
"superior está unha lista dos peores usuarios da memoria para reducir o "
|
|
Packit |
1470ea |
"espazotempo. Máis abaixo de isto están as seguintes sección, cada unha delas "
|
|
Packit |
1470ea |
"dividindo os resultados en maior detalle como se procedera cara abaixo na "
|
|
Packit |
1470ea |
"pila de chamadas. Para ilustrar isto usaremos a saída da orde de arriba."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:49(figure/title)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"<application>Massif</application> output for the unoptimized version of the "
|
|
Packit |
1470ea |
"<application>Swell Foop</application> program."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"A saída de <application>Massif</application> para a versión non optimizada "
|
|
Packit |
1470ea |
"do programa <application>Swell GNOME</application>."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:56(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"<xref linkend=\"optimization-massif-FIG-output-unoptimized\"/> shows a "
|
|
Packit |
1470ea |
"typical postscript output from <application>Massif</application>. This is "
|
|
Packit |
1470ea |
"the result you would get from playing a single game of <application>Swell "
|
|
Packit |
1470ea |
"Foop</application> (version 2.8.0) and then quitting. The postscript file "
|
|
Packit |
1470ea |
"will have a name like <filename>massif.12345.ps</filename> and the text file "
|
|
Packit |
1470ea |
"will be called <filename>massif.12345.txt</filename>. The number in the "
|
|
Packit |
1470ea |
"middle is the process ID of the program that was examined. If you actually "
|
|
Packit |
1470ea |
"try this example you will find two versions of each file, with slightly "
|
|
Packit |
1470ea |
"different numbers, this is because <application>Swell Foop</application> "
|
|
Packit |
1470ea |
"starts a second process and <application>Massif</application> follows that "
|
|
Packit |
1470ea |
"too. We will ignore this second process, it consumes very little memory."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"<xref linkend=\"optimization-massif-FIG-output-unoptimized\"/> mostra unha "
|
|
Packit |
1470ea |
"saída postscript típica de <application>Massif</application>. Este é o "
|
|
Packit |
1470ea |
"resultado que poderá obter ao xogar un único xogo de <application>Swell "
|
|
Packit |
1470ea |
"Foop</application> (versión 2.8.0) e logo saír. O ficheiro postscript terá "
|
|
Packit |
1470ea |
"un nome como <filename>masif.12345.ps</filename> e o ficheiro de texto terá "
|
|
Packit |
1470ea |
"no medio o ID do proceso do programa que foi examinado. Se realmente proba "
|
|
Packit |
1470ea |
"este exemplo poderá atopar dúas versións de cada ficheiro, con números "
|
|
Packit |
1470ea |
"diferentes, isto é porque <application>Swell Foop</application> inicia un "
|
|
Packit |
1470ea |
"segundo proceso e <application>Massif</application> segue os dous. "
|
|
Packit |
1470ea |
"Ignoraremos ese segundo proceso xa que consume moi pouca memoria."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:59(sect1/para)
|
|
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 "
|
|
Packit |
1470ea |
"text file will look something like this:"
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Na parte superior da gráfica vese unha gran banda amarela etiquetada como "
|
|
Packit |
1470ea |
"gdk_pixbuf_new. Semella un candidato ideal para a optimización, pero "
|
|
Packit |
1470ea |
"precisarase usar o ficheiro de texto para topar que está chamando a "
|
|
Packit |
1470ea |
"gdk_pixbuf_new. A parte superior do ficheiro de texto mostrará algo como o "
|
|
Packit |
1470ea |
"seguinte:"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:62(sect1/programlisting)
|
|
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 |
#: C/optimization-massif.xml:77(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"The line with the '=' signs indicates how far down the stack trace we are, "
|
|
Packit |
1470ea |
"in this case we are at the top. After this it lists the heaviest users of "
|
|
Packit |
1470ea |
"memory in order of decreasing spacetime. Spacetime is the product of the "
|
|
Packit |
1470ea |
"amount of memory used and how long it was used for. It corresponds to the "
|
|
Packit |
1470ea |
"area of the bands in the graph. This part of the file tells us what we "
|
|
Packit |
1470ea |
"already know: most of the spacetime is dedicated to gdk_pixbuf_new. To find "
|
|
Packit |
1470ea |
"out what called gdk_pixbuf_new we need to search further down the text file:"
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:80(sect1/programlisting)
|
|
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 |
#: C/optimization-massif.xml:95(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"The first line tells us we are now four levels deep into the stack. Below it "
|
|
Packit |
1470ea |
"is a listing of the function calls that leads from here to gdk_pixbuf_new. "
|
|
Packit |
1470ea |
"Finally there is a list of functions that are at the next level down and "
|
|
Packit |
1470ea |
"call these functions. There are, of course, also entries for levels 1, 2, "
|
|
Packit |
1470ea |
"and 3, but this is the first level to reach right down through the GDK code "
|
|
Packit |
1470ea |
"to the <application>Swell Foop</application> code. From this listing, we can "
|
|
Packit |
1470ea |
"see instantly that the problem code is load_scenario."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"A primeira liña dinos que agora temos catro niveis de profundidade para cada "
|
|
Packit |
1470ea |
"pila. Embaixo hai unha lista das chamadas de funcións que lle leva desde "
|
|
Packit |
1470ea |
"aquí até gdk_pixbuf_new. Finalmente hai unha lista de funcións que están no "
|
|
Packit |
1470ea |
"nivel inmediatamente inferior e chama a esas funcións. Hai, por suposto, "
|
|
Packit |
1470ea |
"tamén entradas para os niveis 1, 2 e 3 pero este é o primeiro nivel a "
|
|
Packit |
1470ea |
"alcazar mediante o código GDK do código de <application>Swell-"
|
|
Packit |
1470ea |
"Foop</application>. Deste esta lista, podemos ver instantaneamente que o "
|
|
Packit |
1470ea |
"código problemático é load_scenario."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:98(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Now that we know what part of our code is using all the spacetime we can "
|
|
Packit |
1470ea |
"look at it and find out why. It turns out that the load_scenario is loading "
|
|
Packit |
1470ea |
"a pixbuf from file and then never freeing that memory. Having identified the "
|
|
Packit |
1470ea |
"problem code, we can start to fix it."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Agora que sabe que parte do código usa todo o espazo de tempo pódese buscar "
|
|
Packit |
1470ea |
"o porque. Resulta que load_scenario está cargando un pixbuf dun ficheiro e "
|
|
Packit |
1470ea |
"nunca libera esa memoria. Tendo identificado o código do problema pódese "
|
|
Packit |
1470ea |
"comezar a arranxalo."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:103(sect1/title)
|
|
Packit |
1470ea |
msgid "Acting on the Results"
|
|
Packit |
1470ea |
msgstr "Actuar sobre os resultados"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:104(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Reducing spacetime consumption is good, but there are two ways of reducing "
|
|
Packit |
1470ea |
"it and they are not equal. You can either reduce the amount of memory "
|
|
Packit |
1470ea |
"allocated, or reduce the amount of time it is allocated for. Consider for a "
|
|
Packit |
1470ea |
"moment a model system with only two processes running. Both processes use up "
|
|
Packit |
1470ea |
"almost all the physical RAM and if they overlap at all then the system will "
|
|
Packit |
1470ea |
"swap and everything will slow down. Obviously if we reduce the memory usage "
|
|
Packit |
1470ea |
"of each process by a factor of two then they can peacefully coexist without "
|
|
Packit |
1470ea |
"the need for swapping. If instead we reduce the time the memory is allocated "
|
|
Packit |
1470ea |
"by a factor of two then the two programs can coexist, but only as long as "
|
|
Packit |
1470ea |
"their periods of high memory use don't overlap. So it is better to reduce "
|
|
Packit |
1470ea |
"the amount of memory allocated."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Reducir o consumo do espazo de tempo é bo, pero hai dúas formas de reducilo "
|
|
Packit |
1470ea |
"e non son iguais. Pode tanto reducir a cantidade de memoria reservada como "
|
|
Packit |
1470ea |
"reducir a cantidade de tempo na que está reservada. Considere por un momento "
|
|
Packit |
1470ea |
"un sistema modelo con só dous procesos executándose. Ámbolos dous procesos "
|
|
Packit |
1470ea |
"usan case toda a RAM física e superpóñense por completo polo que o sistema "
|
|
Packit |
1470ea |
"terá que usar a swap e todo se ralentizará. Se no lugar disto reducimos o "
|
|
Packit |
1470ea |
"tempo que está reservada a memoria por un factor de dous entón os dous "
|
|
Packit |
1470ea |
"programas poden coexistir, pero mentres os seus períodos de alto uso de "
|
|
Packit |
1470ea |
"memoria non se superpoñan. Polo tanto é mellor reducir o consumo de memoria "
|
|
Packit |
1470ea |
"reservada."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:107(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Unfortunately, the choice of optimization is also constrained by the needs "
|
|
Packit |
1470ea |
"of the program. The size of the pixbuf data in <application>Swell Foop</"
|
|
Packit |
1470ea |
"application> is determined by the size of the game's graphics and cannot be "
|
|
Packit |
1470ea |
"easily reduced. However, the amount of time it spends loaded into memory can "
|
|
Packit |
1470ea |
"be drastically reduced.
|
|
Packit |
1470ea |
"optimized\"/> shows the <application>Massif</application> analysis of "
|
|
Packit |
1470ea |
"<application>Swell Foop</application> after being altered to dispose of the "
|
|
Packit |
1470ea |
"pixbufs once the images have been loaded into the X server."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Desafortunadamente, a elección da optimización tamén está limitada polas "
|
|
Packit |
1470ea |
"necesidades do programa. O tamaño dos datos pixbuf en <application>Swell "
|
|
Packit |
1470ea |
"Foop</application> está determinado polo tamaño dos gráficos do xogo e non "
|
|
Packit |
1470ea |
"poden reducirse de forma doada. porén, a cantidade de tempo que gasta "
|
|
Packit |
1470ea |
"cargando en memoria pode reducirse drasticamente.
|
|
Packit |
1470ea |
"=\"optimization-massif-FIG-output-optimized\"/> mostra o análise de "
|
|
Packit |
1470ea |
"<application>Massif</application> de <application>Swell Foop</application> "
|
|
Packit |
1470ea |
"despois de cambiar a disposición dos pixbuf en canto as imaxes se cargan no "
|
|
Packit |
1470ea |
"servidor X."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:111(figure/title)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"<application>Massif</application> output for the optimized "
|
|
Packit |
1470ea |
"<application>Swell Foop</application> program."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"A saída de <application>Massif</application> para o programa optimizado "
|
|
Packit |
1470ea |
"<application>Swell GNOME</application>."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:118(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"The spacetime use of gdk_pixbuf_new is now a thin band that only spikes "
|
|
Packit |
1470ea |
"briefly (it is now the sixteenth band down and shaded magenta). As a bonus, "
|
|
Packit |
1470ea |
"the peak memory use has dropped by 200 kB since the spike occurs before "
|
|
Packit |
1470ea |
"other memory is allocated. If two processes like this were run together the "
|
|
Packit |
1470ea |
"chances of the peak memory usage coinciding, and hence the risk of swapping, "
|
|
Packit |
1470ea |
"would be quite low."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"O uso do espazo de tempo do gdk_pixbuf_new é agora unha banda máis estreita "
|
|
Packit |
1470ea |
"que só ten picos moi brebes (agora é a dezaseisava banda e pintada en "
|
|
Packit |
1470ea |
"maxenta). Ademáis, o pico de uso de memoria baixou 200 kB xa que o pico se "
|
|
Packit |
1470ea |
"produce antes de que se reserve outra memoria. Se dous procesos como este "
|
|
Packit |
1470ea |
"estiveran executándose á vez as opcións dun pico de uso de memoria "
|
|
Packit |
1470ea |
"coincidente, e polo tanto o risco de facer swapping, serán moi poucas."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:121(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Can we do better ? A quick examination of <application>Massif</"
|
|
Packit |
1470ea |
"application>'s text output reveals: g_strdup to be the new major offender."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Podémolo facer mellor? Unha examinación rápida mo texto de saída de "
|
|
Packit |
1470ea |
"<application>Massif</application> revela: g_strdup para ser un ofensor máis "
|
|
Packit |
1470ea |
"importante."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:124(sect1/programlisting)
|
|
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 |
#: C/optimization-massif.xml:139(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"If we look closer though we see that it is called from many, many, places."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Se miramos máis cerca nas partes que vemos se chaman desde moitas partes."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:142(sect1/programlisting)
|
|
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 |
#: C/optimization-massif.xml:158(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"We now face diminishing returns for our optimization efforts. The graph "
|
|
Packit |
1470ea |
"hints at another possible approach: Both the \"other\" and \"heap admin\" "
|
|
Packit |
1470ea |
"bands are quite large. This tells us that there are a lot of small "
|
|
Packit |
1470ea |
"allocations being made from a variety of places. Eliminating these will be "
|
|
Packit |
1470ea |
"difficult, but if they can be grouped then the individual allocations can be "
|
|
Packit |
1470ea |
"larger and the \"heap admin\" overhead can be reduced."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Agora encárase a redución da saída para os esforzos de optimización. O "
|
|
Packit |
1470ea |
"gráfico suxire outra posíbel aproximación: tanto a banda «other» como a "
|
|
Packit |
1470ea |
"«heap admin» son bastante largas. Isto quere dicir que existen moitas "
|
|
Packit |
1470ea |
"pequenas reservas realizadas desde certa variedade de sitios. Eliminalos "
|
|
Packit |
1470ea |
"será difícil, pero se se poden agrupar, entón as reservas son individuais "
|
|
Packit |
1470ea |
"poden ser máis grandes e a elevada banda «heap admin» pode reducirse."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:163(sect1/title)
|
|
Packit |
1470ea |
msgid "Caveats"
|
|
Packit |
1470ea |
msgstr "Advertencias"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:164(sect1/para)
|
|
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 |
"Existen un par de cousas para ter en conta: Primeiramente, só se informa do "
|
|
Packit |
1470ea |
"espazo de tempo como porcentaxe, ten que comparalo co tamaño total do "
|
|
Packit |
1470ea |
"programa para decidir se merece a pena perseguir a cantidade total de "
|
|
Packit |
1470ea |
"memoria. O gráfico, co seu eixe vertical de kilobytes, é bo para iso."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-massif.xml:167(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Secondly, <application>Massif</application> only takes into account the "
|
|
Packit |
1470ea |
"memory used by your own program. Resources like pixmaps are stored in the X "
|
|
Packit |
1470ea |
"server and aren't considered by <application>Massif</application>. In the "
|
|
Packit |
1470ea |
"<application>Swell Foop</application> example we have actually only moved "
|
|
Packit |
1470ea |
"the memory consumption from client-side pixbufs to server-side pixmaps. Even "
|
|
Packit |
1470ea |
"though we cheated there are performance gains. Keeping the image data in the "
|
|
Packit |
1470ea |
"X server makes the graphics routines quicker and removes a lot of inter-"
|
|
Packit |
1470ea |
"process communication. Also, the pixmaps will be stored in a native graphics "
|
|
Packit |
1470ea |
"format which is often more compact than the 32-bit RGBA format used by "
|
|
Packit |
1470ea |
"gdk_pixbuf. To measure the effect of pixmaps, and other X resources use the "
|
|
Packit |
1470ea |
"
|
|
Packit |
1470ea |
"\">xrestop</ulink> program."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:3(chapter/title)
|
|
Packit |
1470ea |
msgid "The Quick Guide to Optimizing GNOME Programs"
|
|
Packit |
1470ea |
msgstr "Guía rápida para optimizar programas de GNOME"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:5(chapter/para)
|
|
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 "
|
|
Packit |
1470ea |
"a collection of hints and tricks is provided."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Esta é unha breve introdución á optimización, dos cómos tanto dos porqués. "
|
|
Packit |
1470ea |
"Déixanse para posteriores artigos os detalles de ferramentas e técnicas "
|
|
Packit |
1470ea |
"individuais pero fornécese unha colección de suxestións e trucos."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:10(sect1/title)
|
|
Packit |
1470ea |
msgid "What are we Optimizing?"
|
|
Packit |
1470ea |
msgstr "Que se está optimizando?"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:11(sect1/para)
|
|
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 "
|
|
Packit |
1470ea |
"the computer happier."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Ao optimizar GNOME o primeiro que hai que lembrar é isto: non se está "
|
|
Packit |
1470ea |
"tentando mellorar o programa, estase tentando mellorando facer que as "
|
|
Packit |
1470ea |
"persoas usen o equipo máis felices."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:14(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Better programs make people happier, but there are some improvements that "
|
|
Packit |
1470ea |
"will make them a lot happier than others: Responsiveness, start-up time, "
|
|
Packit |
1470ea |
"easy to access commands and not having the computer go into swap the moment "
|
|
Packit |
1470ea |
"more than two programs are open."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Programas mellores fan á xente máis feliz pero existen algunhas mellores que "
|
|
Packit |
1470ea |
"faranos máis felices que outras: tempo de resposta, tempo de inicio, "
|
|
Packit |
1470ea |
"facilidade para acceder a ordes e que o equipo non teña que usar a memoria "
|
|
Packit |
1470ea |
"de intercambio cando máis de dous programas estean abertos."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:17(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Traditional optimization tackles concepts like CPU use, code size, the "
|
|
Packit |
1470ea |
"number of mouse clicks and the memory use of the program. This second list "
|
|
Packit |
1470ea |
"has been chosen to correlate with the first list, however there is an "
|
|
Packit |
1470ea |
"important difference: The person using GNOME doesn't care about the second "
|
|
Packit |
1470ea |
"list, but they care a lot about the first list. When optimizing GNOME "
|
|
Packit |
1470ea |
"programs we will reduce CPU use, memory use and all those things, but these "
|
|
Packit |
1470ea |
"are the means to the end, not the final goal. We are optimizing for people."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"A optimización tradicional contempla conceptos como o uso de CPI, o tamaño "
|
|
Packit |
1470ea |
"do código, o número de pulsacións do reato e o uso de memoria de programa. "
|
|
Packit |
1470ea |
"Elixiuse esta segunda lista para correlar como a primeira, porén existe unha "
|
|
Packit |
1470ea |
"diferenza importante. Á persoa que usa GNOME non lle importa a segunda "
|
|
Packit |
1470ea |
"lista, pero sí a primeira. Ao optimizar os programas de GNOME reducirase o "
|
|
Packit |
1470ea |
"uso de CPU, o uso de memoria e todo aquelo, pero son conceptos para o fin, "
|
|
Packit |
1470ea |
"non o obxectivo final. Optimízase para as persoas."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:23(sect1/title)
|
|
Packit |
1470ea |
msgid "Doing the Optimization"
|
|
Packit |
1470ea |
msgstr "Realizar a optimización"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:24(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"The previous section omitted one important qualifier: To optimize something "
|
|
Packit |
1470ea |
"it has to be measurable. You can't measure happiness. However, you can "
|
|
Packit |
1470ea |
"measure start-up time so you can tell if you have improved it. Happiness "
|
|
Packit |
1470ea |
"will then, hopefully, follow."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Na sección anterior omitiuse un calificador importante: optimizar algo debe "
|
|
Packit |
1470ea |
"ser medíbel. Non se pode medir a felicidade. Porén pódese medir o tempo de "
|
|
Packit |
1470ea |
"inicio dun programa para saber se se mellorou. A felicidade do usuario "
|
|
Packit |
1470ea |
"aumentará pois."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:27(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Optimization is the process of measurement, refinement and re-measurement. "
|
|
Packit |
1470ea |
"So the first thing you must do is find a way to measure what you are "
|
|
Packit |
1470ea |
"optimizing. Ideally this measurement is a single number, for example: the "
|
|
Packit |
1470ea |
"time taken to perform a task. This is your benchmark, it is the only way to "
|
|
Packit |
1470ea |
"tell if you are winning or losing. There is a big difference between a "
|
|
Packit |
1470ea |
"program that <emphasis>should</emphasis> be fast and a program that "
|
|
Packit |
1470ea |
"<emphasis>is</emphasis> fast."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"A optimización é un proceso de medida, refinamento e remedida. O primeiro "
|
|
Packit |
1470ea |
"que debe facer é atopar unha forma de medir o que está optimizando. "
|
|
Packit |
1470ea |
"Idealmente a medida é un simple número, por exemplo: o tempo que se tarda en "
|
|
Packit |
1470ea |
"realiar unha tarefa. ESta é a súa proba, é a única forma de saber se está "
|
|
Packit |
1470ea |
"ganando ou perdendo. Existe unha gran diferenza entre un programa que "
|
|
Packit |
1470ea |
"<emphasis>deería</emphasis> ser rápido e un programa que <emphasis>é</"
|
|
Packit |
1470ea |
"emphasis> rápido."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:30(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Once you have a basic benchmark you need to find out why your code is not "
|
|
Packit |
1470ea |
"doing as well as it should. It is tempting to do this by inspection: just "
|
|
Packit |
1470ea |
"looking at the code and trying to spot something that looks like it needs "
|
|
Packit |
1470ea |
"improvement. You will invariably be wrong. Using a profiler to get a "
|
|
Packit |
1470ea |
"detailed break-down of what your program really does is the only way to be "
|
|
Packit |
1470ea |
"sure."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Unha vez que ten unha proba de rendemento básica debe atopar por que o seu "
|
|
Packit |
1470ea |
"código non o está facendo tan ben como debería. É tentado facelo "
|
|
Packit |
1470ea |
"inspeccionando: simplemente mirar o código e tratar de atopar algo que "
|
|
Packit |
1470ea |
"parece que precisa unha mellora. Estará perdendo o tempo, usar un perfilador "
|
|
Packit |
1470ea |
"para obter unha lista detallada do que o seu programa está facendo é, "
|
|
Packit |
1470ea |
"realmente, a única forma de estar seguro."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:33(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Usually the problem is isolated to small sections of code. Pick the worst "
|
|
Packit |
1470ea |
"place and concentrate on that first. Once that is done, rerun the profiler "
|
|
Packit |
1470ea |
"and repeat. As you proceed the gains made at each step will get less and "
|
|
Packit |
1470ea |
"less, at some point you will have to decide that the results are good "
|
|
Packit |
1470ea |
"enough. If your efforts are only extracting 10% improvements then you are "
|
|
Packit |
1470ea |
"well past the point where you should have stopped."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Xeralmente o problema está illado en pequenas partes do código. Elixa a peor "
|
|
Packit |
1470ea |
"parte e concéntrese nesa primeiro. Unha vez que o teña feito, volva ao "
|
|
Packit |
1470ea |
"perfilador e repita o proceso. Segundo proceda, as melloras obtidas en cada "
|
|
Packit |
1470ea |
"paso faranse cada vez máis pequenas, nalgún punto terá que decidir que os "
|
|
Packit |
1470ea |
"resultados son suficientes. Se os seus esforzos só están obtendo un 10% de "
|
|
Packit |
1470ea |
"melloras entón fai tempo que pasou o punto en que debería ter parado."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:36(sect1/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Don't forget the big picture. For example, rather than just trying to speed "
|
|
Packit |
1470ea |
"up 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 "
|
|
Packit |
1470ea |
"calculations be saved and reused? It won't even need to be optimized if it "
|
|
Packit |
1470ea |
"is in a place where the user is never going to notice it. Worse still, the "
|
|
Packit |
1470ea |
"code may already be optimized and is doing the heavy calculations now to "
|
|
Packit |
1470ea |
"avoid doing them later. Code does not run in isolation and neither does the "
|
|
Packit |
1470ea |
"optimization process."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Non esqueza a visión xeral. Por exemplo, fronte a só tentar incrementar o "
|
|
Packit |
1470ea |
"rendemento dunha parte do código, pregúntese se realmente se precisa dita "
|
|
Packit |
1470ea |
"parte. Pode ser fornecida por outra parte do seu código? Poden os resultados "
|
|
Packit |
1470ea |
"de cálculos previos gardados e ser reusados? Podería non ser nin preciso "
|
|
Packit |
1470ea |
"optimizalo se é un lugar onde nunca vai ir o usuario para que poida notalo. "
|
|
Packit |
1470ea |
"Ou peor aínda, que o código xa estea optimizado e está facendo un cálculo "
|
|
Packit |
1470ea |
"moi grande agora para evitar facelo máis tarde. O código non se executa en "
|
|
Packit |
1470ea |
"separación e tampouco o fai nun proceso de optimizado."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:41(sect1/title)
|
|
Packit |
1470ea |
msgid "Hints"
|
|
Packit |
1470ea |
msgstr "Suxestións"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:43(itemizedlist/title)
|
|
Packit |
1470ea |
msgid "The Fundamentals"
|
|
Packit |
1470ea |
msgstr "O fundamental"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:45(listitem/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Re-run your benchmark after every change you make to the code and keep a log "
|
|
Packit |
1470ea |
"of everything you change and how it affects the benchmark. This lets you "
|
|
Packit |
1470ea |
"undo mistakes and also helps you not to repeat mistakes."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Volva a executar a súa proba de rendemento despois de cada cambio que "
|
|
Packit |
1470ea |
"realice sobre o código e manteña un rexistro de todo o que cambia e de como "
|
|
Packit |
1470ea |
"afecta ao rendemento. Isto permítelle desfacer erros e tamén axúdalle a non "
|
|
Packit |
1470ea |
"repetilos."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:50(listitem/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Make sure your code is correct and bug-free before optimizing it. Check that "
|
|
Packit |
1470ea |
"it remains correct and bug-free after optimization."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Asegúrse de que o seu código é correcto e está libre de erros antes de "
|
|
Packit |
1470ea |
"optimizalo. Comprobe que permanece correcto e libre de erros desois de telo "
|
|
Packit |
1470ea |
"optimizado."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:55(listitem/para)
|
|
Packit |
1470ea |
msgid "Optimize at the high level before optimizing the details."
|
|
Packit |
1470ea |
msgstr "Optimizar ao nivel máis alto antes de optimizar os detalles."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:60(listitem/para)
|
|
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 "
|
|
Packit |
1470ea |
"CPU. Also, see what shortcuts you can make: you can do quicker than quick-"
|
|
Packit |
1470ea |
"sort if you are prepared to make some compromises."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Use o algoritmo correcto. O clásico exemplo de libro de texto é usar "
|
|
Packit |
1470ea |
"ordenación rápida no lugar de ordenación por burbulla. Existen moitos "
|
|
Packit |
1470ea |
"outros, algúns aforran memoria, alguns aforran CPU. Tamén debe ver que "
|
|
Packit |
1470ea |
"atallos de teclado pode crear: pode facelo máis rápido que unha ordenación "
|
|
Packit |
1470ea |
"rápida se está preparado para tomar certos compromisos."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:65(listitem/para)
|
|
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 "
|
|
Packit |
1470ea |
"it is loaded back from disk."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"A optimización é intercambio. Obter resultados mellora os cálculos pero "
|
|
Packit |
1470ea |
"aumenta a memoria en uso. Gardar datos ao disco aforra memoria pero custa "
|
|
Packit |
1470ea |
"tempo ao cargalos de novo desde o disco."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:70(listitem/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Make sure you choose a wide variety of inputs to optimize against. If you "
|
|
Packit |
1470ea |
"don't it is easy to end up with a piece of code carefully optimized for one "
|
|
Packit |
1470ea |
"file and no others."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Asegúrese de elixir certa variedade de entradas que optimizar. SE non o fai "
|
|
Packit |
1470ea |
"é doado que remate cun trozo de código coidadosamente optimizado par aun "
|
|
Packit |
1470ea |
"campo e non para outros."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:75(listitem/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Avoid expensive operations: Multiple small disk reads. Using up lots of "
|
|
Packit |
1470ea |
"memory so disk swapping becomes necessary. Avoid anything that writes or "
|
|
Packit |
1470ea |
"reads from the hard disk unnecessarily. The network is slow too. Also avoid "
|
|
Packit |
1470ea |
"graphics operations that need a response from the X server."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Evite as operacións caras: múltiples lecturas de disco pequenas. Use un "
|
|
Packit |
1470ea |
"montón de memoria para que a área de intercambio («swap») fágase "
|
|
Packit |
1470ea |
"innecesario. Evite calquera cousa que escriba ou lea innecesariamente do "
|
|
Packit |
1470ea |
"disco. A rede tamén é lenta. Evite tamén operacións gráficas que precisan "
|
|
Packit |
1470ea |
"unha resposta do servidor X."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:81(itemizedlist/title)
|
|
Packit |
1470ea |
msgid "Traps for the Unwary"
|
|
Packit |
1470ea |
msgstr "Trampas para os imprudentes"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:83(listitem/para)
|
|
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 "
|
|
Packit |
1470ea |
"down."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Estea atento aos efectos colaterais. Xeralmente son interaccións estranas "
|
|
Packit |
1470ea |
"entre diferentes seccións do código, unha extensión dunha parte pode "
|
|
Packit |
1470ea |
"retardar outra."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:88(listitem/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"When timing code, even on a quiet system, events outside the program add "
|
|
Packit |
1470ea |
"noise to the timing results. Average over multiple runs. If the code is very "
|
|
Packit |
1470ea |
"short, timer resolution is also a problem. In this case measure the time the "
|
|
Packit |
1470ea |
"computer takes to run the code 100 or 1000 times. If the times you are "
|
|
Packit |
1470ea |
"recording are longer than a few seconds, you should be OK."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Ao cronometrar o tempo do código, incluso nun sistema parado, os eventos "
|
|
Packit |
1470ea |
"fora do programa engaden ruido aos resultados de tempo. Faga unha medida "
|
|
Packit |
1470ea |
"sobre múltiples execucións. Se o código é moi pequeno a resolución do tempo "
|
|
Packit |
1470ea |
"tamén é un problema. Neste caso mida o tempo que o equipo tarda en executar "
|
|
Packit |
1470ea |
"o código 100 ou 1000 veces. Se os tempos que está obtendo son algo "
|
|
Packit |
1470ea |
"superiores a uns poucos segundos todo debería estar correcto."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:93(listitem/para)
|
|
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 |
"É moi doado perferse co perfilador. Existen historias de programadores "
|
|
Packit |
1470ea |
"optimizando o búcle de inactividade porque é onde se perdía todo o seu "
|
|
Packit |
1470ea |
"tempo. Non optimice código do que o usuario non se preocupe."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:98(listitem/para)
|
|
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 "
|
|
Packit |
1470ea |
"using."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Lembre os resultados do servidor X. O uso de memoria do seu programa non "
|
|
Packit |
1470ea |
"inclúe os pixmaps almacenados nos procesos do servidor X, pero aínda seguen "
|
|
Packit |
1470ea |
"usando memoria. Use xrestop para ver os recursos que está usando o seu "
|
|
Packit |
1470ea |
"programa."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:104(itemizedlist/title)
|
|
Packit |
1470ea |
msgid "Low Level Hints"
|
|
Packit |
1470ea |
msgstr "Consellos de baixo nivel"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:106(listitem/para)
|
|
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 "
|
|
Packit |
1470ea |
"usually bad. Some is only briefly allocated, this may be quite acceptable. "
|
|
Packit |
1470ea |
"Tools like massif use the concept of space-time, the product of memory used "
|
|
Packit |
1470ea |
"and the duration it was allocated for, instead."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Ao optimizar o uso de memoria considere a diferenza entre o uso de pico e o "
|
|
Packit |
1470ea |
"uso medio de memoria. Algunha memoria sempre está reservada, isto xeralmente "
|
|
Packit |
1470ea |
"é malo. Algunha está temporalmente reservada, isto pode ser aceptábel. "
|
|
Packit |
1470ea |
"Ferramentas como massif usan o concepto de espazo-tempo, o produto da "
|
|
Packit |
1470ea |
"memoria usada e o tempo durante o que estivo reservada."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:111(listitem/para)
|
|
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 "
|
|
Packit |
1470ea |
"long no amount of micro-optimization will help and you will have to change "
|
|
Packit |
1470ea |
"your design. Make sure the compiler doesn't optimize away your empty loop."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Controle o tempo de trozos de código simplificados que só fan cousas "
|
|
Packit |
1470ea |
"esenciais, isto fornece un límite absoluto inferior no tempo que usará o "
|
|
Packit |
1470ea |
"código. Por exemplo, ao optimizar un búcle, controle o tempo do búcle "
|
|
Packit |
1470ea |
"baleiro. Se aínda é moito tempo calquera intento de optimización non axudará "
|
|
Packit |
1470ea |
"e deberá cambiar o seu deseño. Asegúrese de que o compilador non desoptimiza "
|
|
Packit |
1470ea |
"o búcle baleiro."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:116(listitem/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Move code out from inside loops. A slightly more complicated piece of code "
|
|
Packit |
1470ea |
"that is executed once is far quicker than a simple piece of code executed a "
|
|
Packit |
1470ea |
"thousand times. Avoid calling slow code often."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"mova o código fora dos bucles internos. Un anaco de código máis complicado "
|
|
Packit |
1470ea |
"que se executa unha soa vez é moito máis rápido que un trozo de código máis "
|
|
Packit |
1470ea |
"sinxelo que se executa mil veces. Evite chamar habitualmente a código lento."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:121(listitem/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Give the compiler as many hints as possible. Use the const keyword. Use "
|
|
Packit |
1470ea |
"<envar>G_INLINE_FUNC</envar> for short, frequently called, functions. Look "
|
|
Packit |
1470ea |
"up <envar>G_GNUC_PURE</envar>, <envar>G_LIKELY</envar> and the other glib "
|
|
Packit |
1470ea |
"miscellaneous macros. Use the macros instead of gcc-specific keywords to "
|
|
Packit |
1470ea |
"ensure portability."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Forneza ao compilador tantas suxestións como lle sea posíbel. Usa a palabra "
|
|
Packit |
1470ea |
"chave «const». Use <envar>G_INLINE_FUNC</envar> para funcións curtas "
|
|
Packit |
1470ea |
"frecuentemente chamadas. Busque <envar>G_GNUC_PURE</envar>, <envar>G_LIKELY</"
|
|
Packit |
1470ea |
"envar> e outras macros misceláneas de glib. Use as macros no lugar de "
|
|
Packit |
1470ea |
"palabras chave específicas de gcc para asegurar a portabilidade."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:126(listitem/para)
|
|
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 |
"Non use linguaxes de ensamblado. O código non é portábel e pode ser máis "
|
|
Packit |
1470ea |
"rápido nun procesador que noutro, ademais non está garantizado que sea "
|
|
Packit |
1470ea |
"rápido en cada procesador que admite esa arquitectura (p.ex. Athlon contra "
|
|
Packit |
1470ea |
"Pentium 4)."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:131(listitem/para)
|
|
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 |
"Non rescriba unha rutina existente dunha biblioteca a non ser que estea "
|
|
Packit |
1470ea |
"seguro de que é demasiado lenta. Moitas rutinas de bibliotecas de uso "
|
|
Packit |
1470ea |
"intensivo pola CPU xa se optimizaron. Algunhas rutinas de bibliotecas son "
|
|
Packit |
1470ea |
"lentas, especialmente aquelas que realizan chamadas ao sistema operativo."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:136(listitem/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Minimize the number of libraries you link to. The fewer libraries to link "
|
|
Packit |
1470ea |
"in, the faster the program starts. This is a difficult thing to do with "
|
|
Packit |
1470ea |
"GNOME."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Minimice o número de bibliotecas ás que liga. Canto menor sexa o número de "
|
|
Packit |
1470ea |
"bibliotecas a ligar, máis rápido se iniciará o programa. É unha tarefa "
|
|
Packit |
1470ea |
"difícil en GNOME."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:142(itemizedlist/title)
|
|
Packit |
1470ea |
msgid "High Level Tricks"
|
|
Packit |
1470ea |
msgstr "Trucos de alto nivel"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:144(listitem/para)
|
|
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 "
|
|
Packit |
1470ea |
"thinking about what they are going to do next to perform some calculations "
|
|
Packit |
1470ea |
"in anticipation. Do calculations while waiting for data to be loaded off "
|
|
Packit |
1470ea |
"disk. Take advantage of multiple resources, use them all at once."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"A ventaxa da concurrencia. Isto non significa simplemente usar varios "
|
|
Packit |
1470ea |
"procesadores, tamén significa aproveitarse do tempo que o usuario pasa "
|
|
Packit |
1470ea |
"pensando en que fará despois, para realizar algúns cálculos anticipados. "
|
|
Packit |
1470ea |
"Faga cálculos mentres se agarda a carga de datos desde o disco. Aprovéitese "
|
|
Packit |
1470ea |
"dos recursos múltiples, úseos todos á vez."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:149(listitem/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"Cheat. The user only has to think that the computer is fast, it doesn't "
|
|
Packit |
1470ea |
"matter whether it actually is or not. It is the time between the command and "
|
|
Packit |
1470ea |
"the answer that is important, it doesn't matter if the response is pre-"
|
|
Packit |
1470ea |
"calculated, cached, or will in fact be worked out later at a more convenient "
|
|
Packit |
1470ea |
"time, as long as the user gets what they expect."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Engane. O usuario só ten que pensar que o equipo é rápido, non importa se "
|
|
Packit |
1470ea |
"realmente o é ou non. É o tempo entre a orde e a resposta o que importa, non "
|
|
Packit |
1470ea |
"importa se a resposta esta precalculada, cacheada ou se traballará nela en "
|
|
Packit |
1470ea |
"calquera momento posterior conveniente, sempre que o usuario obteña o que "
|
|
Packit |
1470ea |
"agarda."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:154(listitem/para)
|
|
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 "
|
|
Packit |
1470ea |
"though, if you spend too long in the idle loop your program will become "
|
|
Packit |
1470ea |
"sluggish. So regularly give control back to the main loop."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Facer cousas no búcle ocioso. É máis doado programar usando multifíos e "
|
|
Packit |
1470ea |
"facer cousas por detrás dos ollos do usuario. Teña coidado, se pasa gasta "
|
|
Packit |
1470ea |
"moito tempo no bucle ocioso o seu programa podería volverse lento. Polo que "
|
|
Packit |
1470ea |
"de forma regular déalle de novo o control ao bucle principal."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#: C/optimization-intro.xml:159(listitem/para)
|
|
Packit |
1470ea |
msgid ""
|
|
Packit |
1470ea |
"If all else fails, tell the user that the code is going to be slow and put "
|
|
Packit |
1470ea |
"up a progress bar. They won't be as happy as if you had just presented the "
|
|
Packit |
1470ea |
"results, but they will at least know the program hasn't crashed and they can "
|
|
Packit |
1470ea |
"go get a cup of coffee."
|
|
Packit |
1470ea |
msgstr ""
|
|
Packit |
1470ea |
"Se todo isto falla, dígalle ao usuario que o código vai a executarse vai ser "
|
|
Packit |
1470ea |
"lento e móstrelle unha barra de progreso. Non estará tan contento con isto "
|
|
Packit |
1470ea |
"como se simplemente lle mostrara os resultados, porén cando menos saberá que "
|
|
Packit |
1470ea |
"o programa non se pechou ou ten problemas e pode ir a tomarse un café "
|
|
Packit |
1470ea |
"mentres."
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#~ msgid "2004-2005"
|
|
Packit |
1470ea |
#~ msgstr "2004-2005"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#~ msgid "Callum McKenzie"
|
|
Packit |
1470ea |
#~ msgstr "Callum McKenzie"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#~ msgid "Robert Love"
|
|
Packit |
1470ea |
#~ msgstr "Robert Love"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#~ msgid "Callum"
|
|
Packit |
1470ea |
#~ msgstr "Callum"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#~ msgid "McKenzie"
|
|
Packit |
1470ea |
#~ msgstr "McKenzie"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#~ msgid "Robert"
|
|
Packit |
1470ea |
#~ msgstr "Robert"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#~ msgid "Love"
|
|
Packit |
1470ea |
#~ msgstr "Love"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#~ msgid "0.1"
|
|
Packit |
1470ea |
#~ msgstr "0.1"
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
#~ msgid "November 2007"
|
|
Packit |
1470ea |
#~ msgstr "Novembro de 2007"
|