GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — python-docs-fa/howto/perf_profiling.po at 3.15 · python/python-docs-fa

Expand file tree

/

perf_profiling.po

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
411 lines (355 loc) · 35.8 KB
/

perf_profiling.po

Copy path

File metadata and controls

411 lines (355 loc) · 35.8 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Danial Behzadi <[email protected]>, 2025
# Revisto <[email protected]>, 2025
# Sepehr Rasouli <[email protected]>, 2026
# arman mohebali <[email protected]>, 2026
#
msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-11-06 04:12+0000\n"
"PO-Revision-Date: 2026-09-11 14:09+0330\n"
"Last-Translator: Sepehr Rasouli <[email protected]>, 2026\n"
"Language-Team: Persian (https://github.com/python/python-docs-fa/)\n"
"Language: fa\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 3.6\n"
msgid "Python support for the ``perf map`` compatible profilers"
msgstr "پشتیبانی پایتون از پروفایل‌گیرهای سازگار با ``perf map``"
msgid "`The Linux perf profiler <https://perf.wiki.kernel.org>`_ and `samply <https://github.com/mstange/samply>`_ are powerful tools that allow you to profile and obtain information about the performance of your application. Both tools have vibrant ecosystems that aid with the analysis of the data they produce."
msgstr "ابزار پروفایل‌گیر `Linux perf <https://perf.wiki.kernel.org>`_ و `samply <https://github.com/mstange/samply>`_ ابزارهای قدرتمندی هستند که به شما امکان می‌دهند عملکرد برنامه‌ی خود را پروفایل کرده و اطلاعاتی درباره‌ی آن به دست آورید. هر دو ابزار دارای اکوسیستم‌های پویایی هستند که به تحلیل داده‌های تولیدشده توسط آن‌ها کمک می‌کنند."
msgid "The main problem with using these profilers with Python applications is that they only get information about native symbols, that is, the names of functions and procedures written in C. This means that the names and file names of Python functions in your code will not appear in the profiler output."
msgstr "مشکل اصلی استفاده از این پروفایل‌گیرها با برنامه‌های پایتون این است که آن‌ها فقط اطلاعات مربوط به نمادهای بومی، یعنی نام توابع و رویه‌های نوشته‌شده به زبان C را دریافت می‌کنند. این بدان معناست که نام‌ها و نام‌های پرونده‌ی توابع پایتون در کد شما در خروجی پروفایل‌گیر ظاهر نخواهند شد."
msgid "Since Python 3.12, the interpreter can run in a special mode that allows Python functions to appear in the output of compatible profilers. When this mode is enabled, the interpreter will interpose a small piece of code compiled on the fly before the execution of every Python function and it will teach the profiler the relationship between this piece of code and the associated Python function using :doc:`perf map files <../c-api/perfmaps>`."
msgstr "از پایتون ۳.۱۲ به بعد، مفسر می‌تواند در حالت ویژه‌ای اجرا شود که به توابع پایتون اجازه می‌دهد در خروجی پروفایل‌گیرهای سازگار ظاهر شوند. هنگامی که این حالت فعال است، مفسر قطعه کد کوچکی را که در لحظه (on the fly) کامپایل‌شده است پیش از اجرای هر تابع پایتون قرار می‌دهد و با استفاده از :doc:`perf map files <../c-api/perfmaps>` به پروفایل‌گیر می‌آموزد که رابطه‌ی میان این قطعه کد و تابع پایتون مرتبط چیست."
msgid "Support for profiling is available on Linux and macOS on select architectures. Perf is available on Linux, while samply can be used on both Linux and macOS. samply support on macOS is available starting from Python 3.15. Check the output of the ``configure`` build step or check the output of ``python -m sysconfig | grep HAVE_PERF_TRAMPOLINE`` to see if your system is supported."
msgstr "پشتیبانی از پروفایل‌گیری روی لینوکس و مک‌اواس در معماری‌های خاصی در دسترس است. ابزار Perf روی لینوکس در دسترس است، در حالی که samply را می‌توان هم روی لینوکس و هم روی مک‌اواس استفاده کرد. پشتیبانی از samply روی مک‌اواس از پایتون ۳.۱۵ به بعد در دسترس است. خروجی مرحله‌ی ساخت ``configure`` را بررسی کنید یا خروجی دستور ``python -m sysconfig | grep HAVE_PERF_TRAMPOLINE`` را بررسی کنید تا ببینید آیا سیستم شما پشتیبانی می‌شود یا خیر."
msgid "For example, consider the following script:"
msgstr "برای مثال، اسکریپت زیر را در نظر بگیرید:"
msgid ""
"def foo(n):\n"
" result = 0\n"
" for _ in range(n):\n"
" result += 1\n"
" return result\n"
"\n"
"def bar(n):\n"
" foo(n)\n"
"\n"
"def baz(n):\n"
" bar(n)\n"
"\n"
"if __name__ == \"__main__\":\n"
" baz(1000000)"
msgstr ""
"def foo(n):\n"
" result = 0\n"
" for _ in range(n):\n"
" result += 1\n"
" return result\n"
"\n"
"def bar(n):\n"
" foo(n)\n"
"\n"
"def baz(n):\n"
" bar(n)\n"
"\n"
"if __name__ == \"__main__\":\n"
" baz(1000000)"
msgid "We can run ``perf`` to sample CPU stack traces at 9999 hertz::"
msgstr "می‌توانیم ``perf`` را برای نمونه‌برداری از ردگیری‌های پشته‌ی CPU با نرخ ۹۹۹۹ هرتز اجرا کنیم::"
msgid "$ perf record -F 9999 -g -o perf.data python my_script.py"
msgstr "$ perf record -F 9999 -g -o perf.data python my_script.py"
msgid "Then we can use ``perf report`` to analyze the data:"
msgstr "سپس می‌توانید از ``perf report`` برای تحلیل داده‌ها استفاده کنید:"
msgid ""
"$ perf report --stdio -n -g\n"
"\n"
"# Children Self Samples Command Shared Object Symbol\n"
"# ........ ........ ............ .......... .................. ..........................................\n"
"#\n"
" 91.08% 0.00% 0 python.exe python.exe [.] _start\n"
" |\n"
" ---_start\n"
" |\n"
" --90.71%--__libc_start_main\n"
" Py_BytesMain\n"
" |\n"
" |--56.88%--pymain_run_python.constprop.0\n"
" | |\n"
" | |--56.13%--_PyRun_AnyFileObject\n"
" | | _PyRun_SimpleFileObject\n"
" | | |\n"
" | | |--55.02%--run_mod\n"
" | | | |\n"
" | | | --54.65%--PyEval_EvalCode\n"
" | | | _PyEval_EvalFrameDefault\n"
" | | | PyObject_Vectorcall\n"
" | | | _PyEval_Vector\n"
" | | | _PyEval_EvalFrameDefault\n"
" | | | PyObject_Vectorcall\n"
" | | | _PyEval_Vector\n"
" | | | _PyEval_EvalFrameDefault\n"
" | | | PyObject_Vectorcall\n"
" | | | _PyEval_Vector\n"
" | | | |\n"
" | | | |--51.67%--_PyEval_EvalFrameDefault\n"
" | | | | |\n"
" | | | | |--11.52%--_PyCompactLong_Add\n"
" | | | | | |\n"
" | | | | | |--2.97%--_PyObject_Malloc\n"
"..."
msgstr ""
"$ perf report --stdio -n -g\n"
"\n"
"# Children Self Samples Command Shared Object Symbol\n"
"# ........ ........ ............ .......... .................. ..........................................\n"
"#\n"
" 91.08% 0.00% 0 python.exe python.exe [.] _start\n"
" |\n"
" ---_start\n"
" |\n"
" --90.71%--__libc_start_main\n"
" Py_BytesMain\n"
" |\n"
" |--56.88%--pymain_run_python.constprop.0\n"
" | |\n"
" | |--56.13%--_PyRun_AnyFileObject\n"
" | | _PyRun_SimpleFileObject\n"
" | | |\n"
" | | |--55.02%--run_mod\n"
" | | | |\n"
" | | | --54.65%--PyEval_EvalCode\n"
" | | | _PyEval_EvalFrameDefault\n"
" | | | PyObject_Vectorcall\n"
" | | | _PyEval_Vector\n"
" | | | _PyEval_EvalFrameDefault\n"
" | | | PyObject_Vectorcall\n"
" | | | _PyEval_Vector\n"
" | | | _PyEval_EvalFrameDefault\n"
" | | | PyObject_Vectorcall\n"
" | | | _PyEval_Vector\n"
" | | | |\n"
" | | | |--51.67%--_PyEval_EvalFrameDefault\n"
" | | | | |\n"
" | | | | |--11.52%--_PyCompactLong_Add\n"
" | | | | | |\n"
" | | | | | |--2.97%--_PyObject_Malloc\n"
"..."
msgid "As you can see, the Python functions are not shown in the output, only ``_PyEval_EvalFrameDefault`` (the function that evaluates the Python bytecode) shows up. Unfortunately that's not very useful because all Python functions use the same C function to evaluate bytecode so we cannot know which Python function corresponds to which bytecode-evaluating function."
msgstr "همان‌طور که می‌بینید، توابع پایتون در خروجی نمایش داده نمی‌شوند و تنها ``_PyEval_EvalFrameDefault`` (تابعی که بایت‌کد پایتون را ارزیابی می‌کند) نمایش داده می‌شود. متأسفانه این موضوع چندان مفید نیست، زیرا تمام توابع پایتون برای ارزیابی بایت‌کد از یک تابع C یکسان استفاده می‌کنند؛ بنابراین نمی‌توانیم بدانیم کدام تابع پایتون با کدام تابع ارزیابی بایت‌کد متناظر است."
msgid "Instead, if we run the same experiment with ``perf`` support enabled we get:"
msgstr "در عوض، اگر همان آزمایش را با فعال بودن پشتیبانی ``perf`` اجرا کنیم، به این نتیجه می‌رسیم:"
msgid ""
"$ perf report --stdio -n -g\n"
"\n"
"# Children Self Samples Command Shared Object Symbol\n"
"# ........ ........ ............ .......... .................. .....................................................................\n"
"#\n"
" 90.58% 0.36% 1 python.exe python.exe [.] _start\n"
" |\n"
" ---_start\n"
" |\n"
" --89.86%--__libc_start_main\n"
" Py_BytesMain\n"
" |\n"
" |--55.43%--pymain_run_python.constprop.0\n"
" | |\n"
" | |--54.71%--_PyRun_AnyFileObject\n"
" | | _PyRun_SimpleFileObject\n"
" | | |\n"
" | | |--53.62%--run_mod\n"
" | | | |\n"
" | | | --53.26%--PyEval_EvalCode\n"
" | | | py::<module>:/src/script.py\n"
" | | | _PyEval_EvalFrameDefault\n"
" | | | PyObject_Vectorcall\n"
" | | | _PyEval_Vector\n"
" | | | py::baz:/src/script.py\n"
" | | | _PyEval_EvalFrameDefault\n"
" | | | PyObject_Vectorcall\n"
" | | | _PyEval_Vector\n"
" | | | py::bar:/src/script.py\n"
" | | | _PyEval_EvalFrameDefault\n"
" | | | PyObject_Vectorcall\n"
" | | | _PyEval_Vector\n"
" | | | py::foo:/src/script.py\n"
" | | | |\n"
" | | | |--51.81%--_PyEval_EvalFrameDefault\n"
" | | | | |\n"
" | | | | |--13.77%--_PyCompactLong_Add\n"
" | | | | | |\n"
" | | | | | |--3.26%--_PyObject_Malloc"
msgstr ""
"$ perf report --stdio -n -g\n"
"\n"
"# Children Self Samples Command Shared Object Symbol\n"
"# ........ ........ ............ .......... .................. .....................................................................\n"
"#\n"
" 90.58% 0.36% 1 python.exe python.exe [.] _start\n"
" |\n"
" ---_start\n"
" |\n"
" --89.86%--__libc_start_main\n"
" Py_BytesMain\n"
" |\n"
" |--55.43%--pymain_run_python.constprop.0\n"
" | |\n"
" | |--54.71%--_PyRun_AnyFileObject\n"
" | | _PyRun_SimpleFileObject\n"
" | | |\n"
" | | |--53.62%--run_mod\n"
" | | | |\n"
" | | | --53.26%--PyEval_EvalCode\n"
" | | | py::<module>:/src/script.py\n"
" | | | _PyEval_EvalFrameDefault\n"
" | | | PyObject_Vectorcall\n"
" | | | _PyEval_Vector\n"
" | | | py::baz:/src/script.py\n"
" | | | _PyEval_EvalFrameDefault\n"
" | | | PyObject_Vectorcall\n"
" | | | _PyEval_Vector\n"
" | | | py::bar:/src/script.py\n"
" | | | _PyEval_EvalFrameDefault\n"
" | | | PyObject_Vectorcall\n"
" | | | _PyEval_Vector\n"
" | | | py::foo:/src/script.py\n"
" | | | |\n"
" | | | |--51.81%--_PyEval_EvalFrameDefault\n"
" | | | | |\n"
" | | | | |--13.77%--_PyCompactLong_Add\n"
" | | | | | |\n"
" | | | | | |--3.26%--_PyObject_Malloc"
msgid "Using the samply profiler"
msgstr "استفاده از پروفایل‌گیر samply"
msgid "samply is a modern profiler that can be used as an alternative to perf. It uses the same perf map files that Python generates, making it compatible with Python's profiling support. samply is particularly useful on macOS where perf is not available."
msgstr "samply یک پروفایل‌گیر مدرن است که می‌تواند به عنوان جایگزینی برای perf استفاده شود. این ابزار از همان پرونده‌های نگاشت perf که پایتون تولید می‌کند استفاده می‌کند و آن را با پشتیبانی پروفایل‌گیری پایتون سازگار می‌سازد. samply به‌ویژه در macOS که perf در دسترس نیست، بسیار مفید است."
msgid "To use samply with Python, first install it following the instructions at https://github.com/mstange/samply, then run::"
msgstr "برای استفاده از samply با پایتون، ابتدا آن را با پیروی از دستورالعمل‌های موجود در https://github.com/mstange/samply نصب کنید، سپس این دستور را اجرا کنید::"
msgid "$ samply record PYTHONPERFSUPPORT=1 python my_script.py"
msgstr "$ samply record PYTHONPERFSUPPORT=1 python my_script.py"
msgid "This will open a web interface where you can analyze the profiling data interactively. The advantage of samply is that it provides a modern web-based interface for analyzing profiling data and works on both Linux and macOS."
msgstr "این کار یک رابط وب را باز می‌کند که در آن می‌توانید داده‌های پروفایل‌گیری را به‌صورت تعاملی تحلیل کنید. مزیت samply این است که یک رابط مدرن مبتنی بر وب برای تحلیل داده‌های پروفایل‌گیری فراهم می‌کند و هم روی لینوکس و هم روی مک‌اواس کار می‌کند."
msgid "On macOS, samply support requires Python 3.15 or later. Also on macOS, samply can't profile signed Python executables due to restrictions by macOS. You can profile with Python binaries that you've compiled yourself, or which are unsigned or locally-signed (such as anything installed by Homebrew). In order to attach to running processes on macOS, run ``samply setup`` once (and every time samply is updated) to self-sign the samply binary."
msgstr "روی مک‌اواس، پشتیبانی samply به پایتون ۳.۱۵ یا بالاتر نیاز دارد. همچنین روی مک‌اواس، samply نمی‌تواند فایل‌های اجرایی امضاشده‌ی پایتون را به دلیل محدودیت‌های مک‌اواس پروفایل کند. می‌توانید با باینری‌های پایتون که خودتان کامپایل کرده‌اید، یا باینری‌های امضانشده یا امضاشده‌ی محلی (مانند هر چیزی که توسط Homebrew نصب شده است) پروفایل‌گیری کنید. برای اتصال به فرایندهای در حال اجرا روی مک‌اواس، دستور ``samply setup`` را یک بار (و در هر بار به‌روزرسانی samply) اجرا کنید تا باینری samply را خودامضا کنید."
msgid "How to enable ``perf`` profiling support"
msgstr "چگونه پشتیبانی از پروفایل‌گیری ``perf`` را فعال کنیم"
msgid "``perf`` profiling support can be enabled either from the start using the environment variable :envvar:`PYTHONPERFSUPPORT` or the :option:`-X perf <-X>` option, or dynamically using :func:`sys.activate_stack_trampoline` and :func:`sys.deactivate_stack_trampoline`."
msgstr "می‌توان پشتیبانی از پروفایل‌گیری ``perf`` را یا از ابتدا با استفاده از متغیر محیطی :envvar:`PYTHONPERFSUPPORT` یا گزینه‌ی :option:`-X perf <-X>`، یا به‌صورت پویا با استفاده از :func:`sys.activate_stack_trampoline` و :func:`sys.deactivate_stack_trampoline` فعال کرد."
msgid "The :mod:`!sys` functions take precedence over the :option:`!-X` option, the :option:`!-X` option takes precedence over the environment variable."
msgstr "توابع :mod:`!sys` بر گزینه‌ی :option:`!-X` اولویت دارند، گزینه‌ی :option:`!-X` بر متغیر محیطی اولویت دارد."
msgid "Example, using the environment variable::"
msgstr "مثال، با استفاده از متغیر محیطی::"
msgid ""
"$ PYTHONPERFSUPPORT=1 perf record -F 9999 -g -o perf.data python my_script.py\n"
"$ perf report -g -i perf.data"
msgstr ""
"$ PYTHONPERFSUPPORT=1 perf record -F 9999 -g -o perf.data python my_script.py\n"
"$ perf report -g -i perf.data"
msgid "Example, using the :option:`!-X` option::"
msgstr "مثال، با استفاده از گزینه :option:`!-X`::"
msgid ""
"$ perf record -F 9999 -g -o perf.data python -X perf my_script.py\n"
"$ perf report -g -i perf.data"
msgstr ""
"$ perf record -F 9999 -g -o perf.data python -X perf my_script.py\n"
"$ perf report -g -i perf.data"
msgid "Example, using the :mod:`sys` APIs in file :file:`example.py`:"
msgstr "مثال، استفاده از APIهای :mod:`sys` در پرونده :file:`example.py`:"
msgid ""
"import sys\n"
"\n"
"sys.activate_stack_trampoline(\"perf\")\n"
"do_profiled_stuff()\n"
"sys.deactivate_stack_trampoline()\n"
"\n"
"non_profiled_stuff()"
msgstr ""
"import sys\n"
"\n"
"sys.activate_stack_trampoline(\"perf\")\n"
"do_profiled_stuff()\n"
"sys.deactivate_stack_trampoline()\n"
"\n"
"non_profiled_stuff()"
msgid "...then::"
msgstr "...سپس::"
msgid ""
"$ perf record -F 9999 -g -o perf.data python ./example.py\n"
"$ perf report -g -i perf.data"
msgstr ""
"$ perf record -F 9999 -g -o perf.data python ./example.py\n"
"$ perf report -g -i perf.data"
msgid "How to obtain the best results"
msgstr "چگونه بهترین نتایج را به دست آوریم"
msgid "For best results, keep frame pointers enabled. On supported GCC-compatible toolchains, CPython builds itself with ``-fno-omit-frame-pointer`` and similar flags (see :option:`--without-frame-pointers` for details). These flags allow profilers to unwind using only the frame pointer and not on DWARF debug information. This is because as the code that is interposed to allow ``perf`` support is dynamically generated it doesn't have any DWARF debugging information available."
msgstr "برای کسب بهترین نتیجه، اشاره‌گرهای قاب را فعال نگه دارید. روی زنجیره‌ابزارهای سازگار با GCC که پشتیبانی می‌شوند، سی‌پایتون خودش را با پرچم‌های ``-fno-omit-frame-pointer`` و مشابه آن می‌سازد (برای جزئیات بیشتر :option:`--without-frame-pointers` را ببینید). این پرچم‌ها به پروفایل‌گیرها اجازه می‌دهند تا با استفاده تنها از اشاره‌گر قاب و نه اطلاعات اشکال‌زدایی DWARF، پشته‌گشایی (unwind) کنند. دلیل این امر آن است که کدی که برای فراهم کردن پشتیبانی از ``perf`` میان‌گذاری (interpose) می‌شود، به شکل پویا تولید شده است و هیچ اطلاعات اشکال‌زدایی DWARFی در دسترس ندارد."
msgid "You can check if your system has been compiled with this flag by running::"
msgstr "می‌توانید با اجرای دستور زیر بررسی کنید که آیا سیستم شما با این پرچم کامپایل شده است::"
msgid "$ python -m sysconfig | grep 'no-omit-frame-pointer'"
msgstr "$ python -m sysconfig | grep 'no-omit-frame-pointer'"
msgid "If you don't see any output it means that your interpreter has not been compiled with frame pointers and therefore it may not be able to show Python functions in the output of ``perf``."
msgstr "اگر هیچ خروجی نمی‌بینید، به این معناست که مفسر شما با اشاره‌گرهای فریم (frame pointers) کامپایل نشده است و بنابراین ممکن است نتواند توابع پایتون را در خروجی ``perf`` نمایش دهد."
msgid "How to work without frame pointers"
msgstr "چگونه بدون اشاره‌گرهای فریم کار کنیم"
msgid "If you are working with a Python interpreter that has been compiled without frame pointers, you can still use the ``perf`` profiler, but the overhead will be a bit higher because Python needs to generate unwinding information for every Python function call on the fly. Additionally, ``perf`` will take more time to process the data because it will need to use the DWARF debugging information to unwind the stack and this is a slow process."
msgstr "اگر با مفسر پایتونی کار می‌کنید که بدون اشاره‌گرهای فریم کامپایل شده است، همچنان می‌توانید از پروفایل‌گیر ``perf`` استفاده کنید، اما سربار آن کمی بیشتر خواهد بود، زیرا پایتون باید برای هر فراخوانی تابع پایتون، اطلاعات باز کردن پشته (unwinding) را در لحظه تولید کند. علاوه بر این، ``perf`` برای پردازش داده‌ها زمان بیشتری نیاز خواهد داشت، زیرا باید از اطلاعات اشکال‌زدایی DWARF برای باز کردن پشته استفاده کند و این فرآیندی کند است."
msgid "To enable this mode, you can use the environment variable :envvar:`PYTHON_PERF_JIT_SUPPORT` or the :option:`-X perf_jit <-X>` option, which will enable the JIT mode for the ``perf`` profiler."
msgstr "برای فعال کردن این حالت، می‌توانید از متغیر محیطی :envvar:`PYTHON_PERF_JIT_SUPPORT` یا گزینه‌ی :option:`-X perf_jit <-X>` استفاده کنید، که حالت JIT را برای پروفایل‌گیر ``perf`` فعال می‌کند."
msgid "Due to a bug in the ``perf`` tool, only ``perf`` versions higher than v6.8 will work with the JIT mode. The fix was also backported to the v6.7.2 version of the tool."
msgstr "به دلیل وجود یک اشکال در ابزار ``perf``، فقط نسخه‌های ``perf`` بالاتر از v6.8 با حالت JIT کار می‌کنند. این اصلاحیه همچنین به نسخه v6.7.2 این ابزار نیز بک‌پورت شده است."
msgid "Note that when checking the version of the ``perf`` tool (which can be done by running ``perf version``) you must take into account that some distros add some custom version numbers including a ``-`` character. This means that ``perf 6.7-3`` is not necessarily ``perf 6.7.3``."
msgstr "توجه داشته باشید که هنگام بررسی نسخه‌ی ابزار ``perf`` (که این کار را می‌توان با اجرای ``perf version`` انجام داد)، باید در نظر داشته باشید که برخی توزیع‌ها شماره‌های نسخه‌ی سفارشی شامل نویسه‌ی ``-`` را اضافه می‌کنند. این بدان معناست که ``perf 6.7-3`` لزوماً ``perf 6.7.3`` نیست."
msgid "When using the perf JIT mode, you need an extra step before you can run ``perf report``. You need to call the ``perf inject`` command to inject the JIT information into the ``perf.data`` file.::"
msgstr "هنگام استفاده از حالت JIT در perf، پیش از آنکه بتوانید ``perf report`` را اجرا کنید، به یک مرحله اضافی نیاز دارید. باید دستور ``perf inject`` را فراخوانی کنید تا اطلاعات JIT را به پرونده ``perf.data`` وارد کنید.::"
msgid ""
"$ perf record -F 9999 -g -k 1 --call-graph dwarf -o perf.data python -Xperf_jit my_script.py\n"
"$ perf inject -i perf.data --jit --output perf.jit.data\n"
"$ perf report -g -i perf.jit.data"
msgstr ""
"$ perf record -F 9999 -g -k 1 --call-graph dwarf -o perf.data python -Xperf_jit my_script.py\n"
"$ perf inject -i perf.data --jit --output perf.jit.data\n"
"$ perf report -g -i perf.jit.data"
msgid "or using the environment variable::"
msgstr "یا با استفاده از متغیر محیطی::"
msgid ""
"$ PYTHON_PERF_JIT_SUPPORT=1 perf record -F 9999 -g --call-graph dwarf -o perf.data python my_script.py\n"
"$ perf inject -i perf.data --jit --output perf.jit.data\n"
"$ perf report -g -i perf.jit.data"
msgstr ""
"$ PYTHON_PERF_JIT_SUPPORT=1 perf record -F 9999 -g --call-graph dwarf -o perf.data python my_script.py\n"
"$ perf inject -i perf.data --jit --output perf.jit.data\n"
"$ perf report -g -i perf.jit.data"
#, fuzzy
#| msgid "``perf inject --jit`` command will read ``perf.data``, automatically pick up the perf dump file that Python creates (in ``/tmp/perf-$PID.dump``), and then create ``perf.jit.data`` which merges all the JIT information together. It should also create a lot of ``jitted-XXXX-N.so`` files in the current directory which are ELF images for all the JIT trampolines that were created by Python."
msgid "``perf inject --jit`` command will read ``perf.data``, automatically pick up the perf dump file that Python creates (in ``/tmp/jit-$PID.dump``), and then create ``perf.jit.data`` which merges all the JIT information together. It should also create a lot of ``jitted-XXXX-N.so`` files in the current directory which are ELF images for all the JIT trampolines that were created by Python."
msgstr "فرمان ``perf inject --jit`` پرونده ``perf.data`` را می‌خواند، به‌طور خودکار پرونده برون‌ریزی perf را که پایتون ایجاد می‌کند (در ``/tmp/perf-$PID.dump``) دریافت می‌کند و سپس ``perf.jit.data`` را ایجاد می‌کند که همه‌ی اطلاعات JIT را با یکدیگر ادغام می‌کند. همچنین باید تعداد زیادی پرونده ``jitted-XXXX-N.so`` در پوشه‌ی جاری ایجاد کند که تصویرهای ELF برای همه‌ی ترمپولین‌های JIT (JIT trampolines) ایجادشده توسط پایتون هستند."
msgid "When using ``--call-graph dwarf``, the ``perf`` tool will take snapshots of the stack of the process being profiled and save the information in the ``perf.data`` file. By default, the size of the stack dump is 8192 bytes, but you can change the size by passing it after a comma like ``--call-graph dwarf,16384``."
msgstr "هنگام استفاده از ``--call-graph dwarf``، ابزار ``perf`` تصویرهای فوری از پشته‌ی فرایندی که پروفایل‌گیری می‌شود می‌گیرد و اطلاعات را در پرونده ``perf.data`` ذخیره می‌کند. به‌طور پیش‌فرض، اندازه‌ی برون‌ریزی پشته (stack dump) ۸۱۹۲ بایت است، اما می‌توانید اندازه را با قرار دادن آن پس از یک ویرگول، مانند ``--call-graph dwarf,16384``، تغییر دهید."
msgid "The size of the stack dump is important because if the size is too small ``perf`` will not be able to unwind the stack and the output will be incomplete. On the other hand, if the size is too big, then ``perf`` won't be able to sample the process as frequently as it would like as the overhead will be higher."
msgstr "اندازه‌ی برون‌ریزی پشته مهم است، زیرا اگر اندازه بیش از حد کوچک باشد، ``perf`` نمی‌تواند پشته را باز کند و خروجی ناقص خواهد بود. از طرف دیگر، اگر اندازه بیش از حد بزرگ باشد، ``perf`` نمی‌تواند به دفعات دلخواه از فرایند نمونه‌برداری کند، زیرا سربار بیشتر خواهد بود."
msgid "The stack size is particularly important when profiling Python code compiled with low optimization levels (like ``-O0``), as these builds tend to have larger stack frames. If you are compiling Python with ``-O0`` and not seeing Python functions in your profiling output, try increasing the stack dump size to 65528 bytes (the maximum)::"
msgstr "اندازه‌ی پشته به‌ویژه هنگام پروفایل‌گیری کد پایتون کامپایل‌شده با سطح‌های بهینه‌سازی پایین (مانند ``-O0``) اهمیت دارد، زیرا این ساخت‌ها معمولاً فریم‌های پشته بزرگ‌تری دارند. اگر پایتون را با ``-O0`` کامپایل می‌کنید و توابع پایتون را در خروجی پروفایل‌گیری خود نمی‌بینید، سعی کنید اندازه‌ی برون‌ریزی پشته را به ۶۵۵۲۸ بایت (حداکثر) افزایش دهید::"
msgid "$ perf record -F 9999 -g -k 1 --call-graph dwarf,65528 -o perf.data python -Xperf_jit my_script.py"
msgstr "$ perf record -F 9999 -g -k 1 --call-graph dwarf,65528 -o perf.data python -Xperf_jit my_script.py"
msgid "Different compilation flags can significantly impact stack sizes:"
msgstr "پرچم‌های مختلف کامپایل می‌توانند به‌طور قابل‌توجهی بر اندازه‌های پشته تأثیر بگذارند:"
msgid "Builds with ``-O0`` typically have much larger stack frames than those with ``-O1`` or higher"
msgstr "ساخت‌های با ``-O0`` معمولاً فریم‌های پشته بسیار بزرگ‌تری نسبت به ساخت‌های با ``-O1`` یا بالاتر دارند"
msgid "Adding optimizations (``-O1``, ``-O2``, etc.) typically reduces stack size"
msgstr "افزودن بهینه‌سازی‌ها (``-O1``، ``-O2`` و غیره) معمولاً اندازه پشته را کاهش می‌دهد"
msgid "Frame pointers (``-fno-omit-frame-pointer``) generally provide more reliable stack unwinding"
msgstr "اشاره‌گرهای فریم (``-fno-omit-frame-pointer``) معمولاً باز شدن قابل‌اطمینان‌تر پشته را فراهم می‌کنند"
#~ msgid "author"
#~ msgstr "نویسنده"
#~ msgid "Pablo Galindo"
#~ msgstr "پابلو گالیندو"
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.