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

LinkedList 보다 List가 성능이 좋을 것 같습니다. #5

Closed
dimohy opened this issue Mar 25, 2024 · 1 comment
Closed

LinkedList 보다 List가 성능이 좋을 것 같습니다. #5

dimohy opened this issue Mar 25, 2024 · 1 comment

Comments

@dimohy
Copy link
Collaborator

dimohy commented Mar 25, 2024

LinkedList로 바꾼 이유가 있으실 텐데...
LinkedList는 추가, 삭제가 빈번할 때 유리한 구조인데 반해
List는 내부적으로 배열을 사용하기 때문에 인덱싱이 더 유리합니다.

패킷을 만들 때 삭제의 경우가 없고 byte[] 로 변환할 때의 인덱싱이 List가 빠를텐데요,
어떤 이유로 LinkedList로 바꾸셨는지 궁금합니다.

@lukewire129
Copy link
Owner

lukewire129 commented Mar 26, 2024

현재 packetbuilder에서는

제한적이지 않는 바이트들을 쌓을 수 있다는 것에 의해 무의미한 메모리 사용을 최소화해서 가볍고 빠른 기능을 만들어내자가 취지였습니다

다시 생각해보니 가볍고는 해당되지만 빠른이 아닌거 같네요


좀 더 찾아보니 삽입삭제에 대해서도 배열의 중간 삽입/삭제에 대한거였네요..다음버전때 리스트로 변경을 검토 해야할거 같습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants