Profiling/fr: Difference between revisions
(Created page with "==Ressources==") |
(Updating to match new version of source page) |
||
(One intermediate revision by one other user not shown) | |||
Line 31: | Line 31: | ||
==Ressources== |
==Ressources== |
||
* [https://docs.python.org/3/library/profile.html The Python profilers], {{incode|cProfile}} |
* [https://docs.python.org/3/library/profile.html The Python profilers], {{incode|cProfile}} et {{incode|python}}. |
||
* [https://pypi.org/project/pyprof2calltree/ pyprof2calltree] |
* [https://pypi.org/project/pyprof2calltree/ pyprof2calltree] à PyPI; dépôt [https://github.com/pwaller/pyprof2calltree/ pyprof2calltree]. |
||
* [https://forum.freecadweb.org/viewtopic.php?f=10&t=44785 FreeCAD's Python profiling tutorial]. |
* [https://forum.freecadweb.org/viewtopic.php?f=10&t=44785 FreeCAD's Python profiling tutorial]. |
||
{{Powerdocnavi{{#translation:}}}} |
{{Powerdocnavi{{#translation:}}}} |
||
[[Category:Developer Documentation{{#translation:}}]] |
|||
[[Category:Python Code{{#translation:}}]] |
|||
{{clear}} |
Latest revision as of 21:06, 22 August 2020
Description
Le profilage du code de FreeCAD permet de trouver des goulots d'étranglement dans les algorithmes utilisés pour créer ou manipuler des objets.
Pour profiler le code Python, utilisez le module standard cProfile
pour définir les points de début et de fin du profil dans le code.
import cProfile
pr = cProfile.Profile()
pr.enable()
# --------------------------------------
# Lines of code that you want to profile
# --------------------------------------
pr.disable()
pr.dump_stats("/tmp/profile.cprof")
Ensuite, installez et utilisez pyprof2calltree
pour convertir la sortie du profil en entrée cachegrind.
pyprof2calltree -i /tmp/profile.cprof -o /tmp/callgrind.out
Ensuite, visualisez ces informations avec kcachegrind
pour Linux ou qcachegrind
pour Windows.
kcachegrind /tmp/callgrind.out
Ressources
- The Python profilers,
cProfile
etpython
. - pyprof2calltree à PyPI; dépôt pyprof2calltree.
- FreeCAD's Python profiling tutorial.
Hub utilisateurs expérimentés
- Scripts FreeCAD : Python, Introduction à Python, Tutoriel sur les scripts Python, Débuter avec les scripts
- Modules : Modules intégrés, Unités, Quantity
- Ateliers : Création d'atelier, Commands Gui, Les commandes, Installer des ateliers supplémentaires
- Maillages et objets Parts : Scripts Mesh, Script de données topologiques, Conversion objet Mesh en Part, PythonOCC
- Objets paramétriques : Objets créés par script, Viewproviders (Icône personnalisée dans l'arborescence)
- Scénographie : Graphe de scène Coin (Inventor), Pivy
- Interface graphique : Création d'interface, Création d'une boite de dialogue (1, 2, 3, 4, 5), PySide, Exemples PySide débutant, intermédiaire, expérimenté
- Macros : Macros, Comment installer des macros
- Intégration : Intégrer FreeCAD, Intégration de FreeCADGui
- Autre : Expressions, Extraits de codes, Fonction - tracer une ligne, Bibliothèque mathématique vectorielle de FreeCAD (déprécié)