Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stories/luft-performance-report-2 #14

Open
hiddenest opened this issue Feb 18, 2024 · 2 comments
Open

stories/luft-performance-report-2 #14

hiddenest opened this issue Feb 18, 2024 · 2 comments
Labels

Comments

@hiddenest
Copy link

Luft 성능 리포트 2: 더 많은 코호트에 대한 리텐션 집계

https://engineering.ab180.co/831b9b63-4cd2-4540-92b5-fd8ed444df18

@hiddenest
Copy link
Author

안녕하세요! 유익한 정보 공유 감사합니다 :)
포스트 읽던 중에 이해되지 않는 부분이 있어서 질문 드리고 싶어요.

`3. 효율적 자료 구조 활용` 부분에서 2차원 배열 대신 1차원 배열을 사용하여 성능 개선을 유도한다고 하셨는데, 고정 크기 배열에서 n차원 배열과 1차원 배열의 구현은 완전히 동일하다고 알고 있었는데 제가 잘못 알고 있었던 걸까요? 답변 주시면 감사하겠습니다. 좋은 하루 되세요 :)

This comment was made by Disqus. 2024-02-14 09:13:33 송민기(송민기)

@hiddenest
Copy link
Author

hiddenest commented Feb 18, 2024

말씀해주신 것처럼 배열 (정확히는 slice) 구현체의 차이에 의한 성능 개선이 있었던 것은 아닙니다.
대신 인덱싱 오버헤드, 캐시 히트율 감소 등의 이유로 성능 차이가 있었습니다.
실제 워크로드와 유사한 벤치마크를 만들어 보았는데 참고하시면 좋을 것 같습니다. (여기서는 약 8배 정도의 성능 차이가 있었습니다.)

벤치마크 결과:

BenchmarkClearSlngleDimensionSlice-12    10574814       120.2 ns/op
BenchmarkClearDoubleDimensionSlice-12     1000000      1011 ns/op

코드: https://github.com/hueypark/benchmark/blob/main/slice/clear_test.go

@hiddenest hiddenest changed the title 831b9b63-4cd2-4540-92b5-fd8ed444df18 stories/luft-performance-report-2 Feb 18, 2024
@ab180 ab180 deleted a comment from hiddenest Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant