@
luozic 从 profiler 看还是慢在网络请求和生成图片那了
Total time: 0.691589 s
File: upvote_func/
upvote_func.pyFunction: generate_upvote_share_image at line 90
Line # Hits Time Per Hit % Time Line Contents
==============================================================
90 @
func_line_time 91 def generate_upvote_share_image(organizer_id):
92 1 1509.0 1509.0 0.2 user_info = get_user_info(int(organizer_id), ["user_avatar"])
93 1 1.0 1.0 0.0 if not user_info:
94 return
95 1 1.0 1.0 0.0 user_avatar_link = user_info.get("user_avatar")
96 1 0.0 0.0 0.0 if not user_avatar_link:
97 return
98 1 4.0 4.0 0.0 scene = UPVOTE_SHARE_IMAGE_SCENE.format(organizer_id)
99 1 0.0 0.0 0.0 mini_program_code_image_io = get_mini_program_code(
100 1 374455.0 374455.0 54.1 UPVOTE_SHARE_IMAGE_PATH, scene)
101 1 4.0 4.0 0.0 if not mini_program_code_image_io:
102 return
103 1 315615.0 315615.0 45.6 return generate_image(user_avatar_link, mini_program_code_image_io)