nhập là quá lâu:nhập khẩu cực kỳ chậm chạp của matplotlib AFM
from matplotlib import pylab as plt --> 3.0124739 secs
Đây là sản phẩm của cProfile, trong đó cho thấy rõ vấn đề là afm.py, đó là một số giao diện cho Adobe Font Metrics.. Phiên bản Matplotlib là 1.4.0 - Ubuntu 14.04
5994612 function calls (5992123 primitive calls) in 4.702 seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
182 1.589 0.009 2.372 0.013 afm.py:220(_parse_kern_pairs)
215 0.746 0.003 1.420 0.007 afm.py:180(_parse_char_metrics)
1297990 0.410 0.000 0.410 0.000 {method 'split' of 'str' objects}
839978 0.288 0.000 0.288 0.000 {method 'readline' of 'file' objects}
2 0.254 0.127 4.185 2.093 font_manager.py:544(createFontList)
843308 0.170 0.000 0.170 0.000 {method 'startswith' of 'str' objects}
114276 0.168 0.000 0.205 0.000 afm.py:72(_to_list_of_floats)
1563800 0.125 0.000 0.125 0.000 {len}
839220 0.117 0.000 0.117 0.000 {method 'rstrip' of 'str' objects}
115290 0.116 0.000 0.119 0.000 {method 'decode' of 'str' objects}
117775 0.086 0.000 0.086 0.000 afm.py:56(_to_int)
20 0.061 0.003 0.061 0.003 {built-in method poll}
520 0.040 0.000 0.040 0.000 {method 'get_sfnt' of 'FT2Font' objects}
6910 0.036 0.000 0.036 0.000 {posix.stat}
3372 0.025 0.000 0.038 0.000 posixpath.py:336(normpath)
Bất kỳ ý tưởng nào về cách sửa/tắt nó?
EDIT:
Lăn trở lại 1.3.1 lưu ngày của tôi. Thời gian chạy hiện là 0,2 giây.
Bất kỳ ý tưởng nào tại sao tính năng quay lại hoạt động? Bạn đã gửi báo cáo lỗi với nhà phát triển matplotlib chưa? – JoErNanO
@ JoErNanO, tôi không có ý kiến, xin lỗi, và có Tôi đã gửi một báo cáo lỗi ở đây: https://github.com/matplotlib/matplotlib/issues/3655 – memecs
thực sự không thể sao chép, lần đầu tiên nhập sau khi cài đặt mất một thời gian nhưng bây giờ nhập ngay lập tức. matplotlib 1.4.0 trên ubuntu 14.04 –