8000 translate `howto/perf_profiling.po` · python/python-docs-zh-tw@e8685a1 · GitHub
[go: up one dir, main page]

Skip to content

Commit e8685a1

Browse files
committed
translate howto/perf_profiling.po
1 parent e1b3c52 commit e8685a1
Copy full SHA for e8685a1

File tree

1 file changed

+51
-19
lines changed

1 file changed

+51
-19
lines changed

howto/perf_profiling.po

Lines changed: 51 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
# SOME DESCRIPTIVE TITLE.
21
# Copyright (C) 2001-2023, Python Software Foundation
32
# This file is distributed under the same license as the Python package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
53
#
6-
#, fuzzy
4+
# Translators:
5+
# Matt Wang <mattwang44@gmail.com>, 2023
76
msgid ""
87
msgstr ""
98
"Project-Id-Version: Python 3.12\n"
109
"Report-Msgid-Bugs-To: \n"
1110
"POT-Creation-Date: 2023-07-17 17:39+0800\n"
12-
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14-
"Language-Team: LANGUAGE <LL@li.org>\n"
11+
"PO-Revision-Date: 2023-08-07 17:39+0800\n"
12+
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
13+
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
14+
"tw)\n"
1515
"Language: zh_TW\n"
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919

2020
#: ../../howto/perf_profiling.rst:7
2121
msgid "Python support for the Linux ``perf`` profiler"
22-
msgstr ""
22+
msgstr "Python 對 Linux ``perf`` 分析器的支援"
2323

2424
#: ../../howto/perf_profiling.rst:0
2525
msgid "author"
26-
msgstr ""
26+
msgstr "作者"
2727

2828
#: ../../howto/perf_profiling.rst:9
2929
msgid "Pablo Galindo"
30-
msgstr ""
30+
msgstr "Pablo Galindo"
3131

3232
#: ../../howto/perf_profiling.rst:11
3333
msgid ""
3636
"of your application. ``perf`` also has a very vibrant ecosystem of tools "
3737
"that aid with the analysis of the data that it produces."
3838
msgstr ""
39+
"`Linux 性能分析器 (Linux perf profiler) <https://perf.wiki.kernel.org>`_ 是一"
40+
"個非常強大的工具,可讓你分析並獲取應用程式相關的性能資訊。``perf`` 還擁有一個"
41+
"非常活躍的工具生態系統,有助於分析其生成的資料。"
3942

4043
#: ../../howto/perf_profiling.rst:17
4144
msgid ""
@@ -45,6 +48,9 @@ msgid ""
4548
"and file names of Python functions in your code will not appear in the "
4649
"output of ``perf``."
4750
msgstr ""
51+
"在 Python 應用程式中使用 ``perf`` 分析器的主要問題是 ``perf`` 僅獲取有關原生"
52+
"符號的資訊,即為用 C 編寫的函式和程序的名稱。這意味著程式碼中的 Python 函式名"
53+
"稱和檔案名稱不會出現在 ``perf`` 的輸出中。"
4854

4955
#: ../../howto/perf_profiling.rst:22
5056
msgid ""
@@ -55,6 +61,10 @@ msgid ""
5561
"will teach ``perf`` the relationship between this piece of code and the "
5662
"associated Python function using :doc:`perf map files <../c-api/perfmaps>`."
5763
msgstr ""
64+
"從 Python 3.12 開始,直譯器可以在特殊模式下運行,該模式允許 Python 函式出現"
65+
"在 ``perf`` 分析器的輸出中。啟用此模式後,直譯器將在執行每個 Python 函式之前"
66+
"插入 (interpose) 一小段動態編譯的程式碼,並使用 :doc:`perf map 檔案 <../c-"
67+
"api/perfmaps>`\\ 來教導 ``perf`` 這段程式碼與相關聯的 Python 函式間的關係。"
5868

5969
#: ../../howto/perf_profiling.rst:31
6070
msgid ""
@@ -63,18 +73,21 @@ msgid ""
6373
"check the output of ``python -m sysconfig | grep HAVE_PERF_TRAMPOLINE`` to "
6474
"see if your system is supported."
6575
msgstr ""
76+
"目前,對 ``perf`` 分析器的支援僅適用於 Linux 的特定架構上。檢查 "
77+
"``configure`` 建構步驟的輸出或檢查 ``python -m sysconfig | grep "
78+
"HAVE_PERF_TRAMPOLINE`` 的輸出來查看你的系統是否支援。"
6679

6780
#: ../../howto/perf_profiling.rst:36
6881
msgid "For example, consider the following script:"
69-
msgstr ""
82+
msgstr "例如,參考以下腳本:"
7083

7184
#: ../../howto/perf_profiling.rst:55
7285
msgid "We can run ``perf`` to sample CPU stack traces at 9999 hertz::"
73-
msgstr ""
86+
msgstr "我們可以運行 ``perf`` 以 9999 赫茲採樣 CPU 堆疊追蹤 (stack trace): ::"
7487

7588
#: ../../howto/perf_profiling.rst:59
7689
msgid "Then we can use ``perf report`` to analyze the data:"
77-
msgstr ""
90+
msgstr "然後我們可以使用 ``perf report`` 來分析資料:"
7891

7992
#: ../../howto/perf_profiling.rst:100
8093
msgid ""
@@ -84,51 +97,63 @@ msgid ""
8497
"functions use the same C function to evaluate bytecode so we cannot know "
8598
"which Python function corresponds to which bytecode-evaluating function."
8699
msgstr ""
100+
"如你所見,Python 函式未顯示在輸出中,僅顯示 ``_Py_Eval_EvalFrameDefault`` "
101+
"(計算 Python 位元組碼 (bytecode) 的函式)。不幸的是,這不是很有用,因為所有 "
102+
"Python 函式都使用相同的 C 函式來計算位元組碼,因此我們無法知道哪個 Python 函"
103+
"式是對應於哪個位元組碼計算函式。"
87104

88105
#: ../../howto/perf_profiling.rst:105
89106
msgid ""
90107
"Instead, if we run the same experiment with ``perf`` support enabled we get:"
91108
msgstr ""
109+
"相反地,如果我們在啟用 ``perf`` 支援的情況下運行相同的實驗,我們會得到:"
92110

93111
#: ../../howto/perf_profiling.rst:152
94112
msgid "How to enable ``perf`` profiling support"
95-
msgstr ""
113+
msgstr "如何啟用 ``perf`` 分析支援"
96114

97115
#: ../../howto/perf_profiling.rst:154
116+
#, fuzzy
98117
msgid ""
99118
"``perf`` profiling support can be enabled either from the start using the "
100119
"environment variable :envvar:`PYTHONPERFSUPPORT` or the :option:`-X perf <-"
101120
"X>` option, or dynamically using :func:`sys.activate_stack_trampoline` and :"
102121
"func:`sys.deactivate_stack_trampoline`."
103122
msgstr ""
123+
"要啟用 ``perf`` 分析支援,可以在一開始就使用環境變數 :envvar:"
124+
"`PYTHONPERFSUPPORT` 或使用 :option:`-X perf <-X>` 選項,也可以使用 :func:"
125+
"`sys.activate_stack_trampoline` 和 :func:`sys.deactivate_stack_trampoline` 來"
126+
"動態啟用。"
104127

105128
#: ../../howto/perf_profiling.rst:160
106129
msgid ""
107130
"The :mod:`!sys` functions take precedence over the :option:`!-X` option, "
108131
"the :option:`!-X` option takes precedence over the environment variable."
109132
msgstr ""
133+
":mod:`!sys` 函式優先於 :option:`!-X` 選項、:option:`!-X` 選項優先於環境變數。"
110134

111135
#: ../../howto/perf_profiling.rst:163
112136
msgid "Example, using the environment variable::"
113-
msgstr ""
137+
msgstr "例如,使用環境變數: ::"
114138

115139
#: ../../howto/perf_profiling.rst:169
116140
msgid "Example, using the :option:`!-X` option::"
117-
msgstr ""
141+
msgstr "例如,使用 :option:`!-X` 選項: ::"
118142

119143
#: ../../howto/perf_profiling.rst:174
120144
msgid "Example, using the :mod:`sys` APIs in file :file:`example.py`:"
121-
msgstr ""
145+
msgstr "例如,在 :file:`example.py` 檔案中使用 :mod:`sys` API:"
122146

123147
#: ../../howto/perf_profiling.rst:186
124148
msgid "...then::"
125-
msgstr ""
149+
msgstr "...然後: ::"
126150

127151
#: ../../howto/perf_profiling.rst:193
128152
msgid "How to obtain the best results"
129-
msgstr ""
153+
msgstr "如何獲得最佳結果"
130154

131155
#: ../../howto/perf_profiling.rst:195
156+
#, fuzzy
132157
msgid ""
133158
"For best results, Python should be compiled with ``CFLAGS=\"-fno-omit-frame-"
134159
"pointer -mno-omit-leaf-frame-pointer\"`` as this allows profilers to unwind "
@@ -137,15 +162,22 @@ msgid ""
137162
"dynamically generated it doesn't have any DWARF debugging information "
138163
"available."
139164
msgstr ""
165+
"為了獲得最佳結果,Python 應使用 ``CFLAGS=\"-fno-omit-frame-pointer -mno-omit-"
166+
"leaf-frame-pointer\"`` 來進行編譯,因為這能允許分析器僅使用 frame 指標而不是"
167+
"在 DWARF 上展開除錯資訊。這是因為,由於插入以允許 ``perf`` 支援的程式碼是動態"
168+
"生成的,因此它沒有任何可用的 DWARF 除錯資訊。"
140169

141170
#: ../../howto/perf_profiling.rst:202
142171
msgid ""
143172
"You can check if your system has been compiled with this flag by running::"
144-
msgstr ""
173+
msgstr "你可以透過運行以下指令來檢查你的系統是否已使用此旗標進行編譯: ::"
145174

146175
#: ../../howto/perf_profiling.rst:206
176+
#, fuzzy
147177
msgid ""
148178
"If you don't see any output it means that your interpreter has not been "
149179
"compiled with frame pointers and therefore it may not be able to show Python "
150180
"functions in the output of ``perf``."
151181
msgstr ""
182+
"如果你沒有看到任何輸出,則意味著你的直譯器尚未使用 frame 指標進行編譯,因此它"
183+
"可能無法在 ``perf`` 的輸出中顯示 Python 函式。"

0 commit comments

Comments
 (0)
0