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

[BE] 이미지 병렬 업로드 기능 추가 #816

Merged
merged 3 commits into from
Nov 5, 2024
Merged

Conversation

Arachneee
Copy link
Contributor

issue

구현 사항

여러 이미지를 순차적으로 업로드하던 기능을 병렬로 업로드할 수 있게 변경합니다.

[10MB 이미지 10개]
순차 업로드 : 5.5s
병렬 업로드 : 2.1s

로 응답시간을 개선했습니다.

추가로 S3Client 호출 시에 발생하는 예외를 추적할 수 있도록 HaengdongException 생성자에 Throwable 을 추가했습니다.

@Arachneee Arachneee added ⌨️ BE Backend ⚙️ feat feature labels Nov 5, 2024
@Arachneee Arachneee requested a review from kunsanglee November 5, 2024 02:00
@Arachneee Arachneee self-assigned this Nov 5, 2024
Copy link

github-actions bot commented Nov 5, 2024

Test Results

 23 files   23 suites   3s ⏱️
140 tests 140 ✅ 0 💤 0 ❌
144 runs  144 ✅ 0 💤 0 ❌

Results for commit dcb5521.

Copy link
Contributor

@kunsanglee kunsanglee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍👍

.toList();

CompletableFuture<List<String>> result = CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CompletableFuture<List<String>> result = CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()]))
CompletableFuture<List<String>> result = CompletableFuture.allOf(new CompletableFuture[0]))
image

futures 리스트의 정확한 크기가 필요한 것이 아니라, 명시적인 타입을 제공하고 배열 리사이징 최적화를 이용할 수 있도록 new CompletableFuture[0]를 매개변수로 넘겨주는게 더 좋겠네요 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Arachneee 확인 후 자체 머지 해주세요.

@Arachneee Arachneee merged commit 724fd20 into be-dev Nov 5, 2024
1 check passed
@Arachneee Arachneee deleted the feature/#813 branch November 5, 2024 05:11
Arachneee added a commit that referenced this pull request Nov 13, 2024
* feat: 이미지 병렬 업로드 기능 추가

* feat: 이미지 업로드 예외 처리 추가

* refactor: 불필요 배열 사이즈 제거
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants