Skip to content

답안 작성 #2

@Marc416

Description

@Marc416

과정

  1. line profiler로 오래 걸리는 로직 찾기
    1.1 main 에 @profiile 붙이기
    students = create_test_data(), manager.process_student_data() 가 느림을 확인
    create_test_data 는 최적화 어려움 process_student_data는 리스트 n번 탐색을 매번 함.
    Image
    1.2 process_student_data 에 @Profile 붙여서 확인

    Image process_student_data에서 쓰는 self.students를 list-> dict 개선해 O(n) -> O(1)로 개선 0.061732 s -> 0.003283 s Image
  2. 결과
    2.1변경후
    Total time: 0.097738 s -> Total time: 0.029406 s
    Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions