Skip to content

Conversation

@oliviarla
Copy link
Collaborator

πŸ”— Related Issue

  • bopCreate/bopInsert/bopInsertAndGetTrimmed/bopGet/bopMultiGet/bopSortMergeGet API κ΅¬ν˜„μ— λŒ€ν•œ 컀밋을 μΆ”κ°€ν•΄λ‘μ—ˆμŠ΅λ‹ˆλ‹€.

⌨️ What I did

  • GenericTranscoder λŒ€μ‹  CFBλ‘œλΆ€ν„° Transcoder<Object> νƒ€μž…μ„ 가져와 Transcoder<T> νƒ€μž…μœΌλ‘œ ν˜•λ³€ν™˜ν•©λ‹ˆλ‹€.
  • Collection νƒ€μž…μ˜ 경우 Decodeν•˜λŠ” λ‘œμ§μ„ 별도 μŠ€λ ˆλ“œμ— μœ„μž„ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
  • μƒˆλ‘œ μΆ”κ°€λœ VO ν΄λž˜μŠ€λ“€κ³Ό 각 λ©”μ„œλ“œμ˜ μ„œλ²„ 응닡 별 λ°˜ν™˜ 값은 링크에 μ •λ¦¬λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

Copy link
Collaborator

@uhm0311 uhm0311 left a comment

Choose a reason for hiding this comment

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

μš°μ„  μ§ˆλ¬Έμž…λ‹ˆλ‹€.

@jhpark816
Copy link
Collaborator

@uhm0311 @brido4125 리뷰가 μ§„ν–‰λ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€.

@uhm0311
Copy link
Collaborator

uhm0311 commented Dec 2, 2025

@jhpark816

#1026 (comment)
제 리뷰가 아직 λ°˜μ˜λ˜μ§€ μ•Šμ€ μƒνƒœμΈ 것 κ°™μŠ΅λ‹ˆλ‹€.

Copy link
Collaborator

@uhm0311 uhm0311 left a comment

Choose a reason for hiding this comment

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

ν•œ 번 더 μ§ˆλ¬Έμž…λ‹ˆλ‹€.

this.trimmedKeys = trimmedKeys;
}

public static <T> SMGetResult<T> mergeSMGetResults(List<SMGetResult<T>> results) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

κΈ°μ‘΄ SMGetResult ν΄λž˜μŠ€μ—μ„œ mergeν•˜λŠ” 둜직과 λ‹¬λΌμ‘ŒμŠ΅λ‹ˆλ‹€.
λ‹¨μˆœν™”ν•˜κΈ°λ‘œ κ²°μ •λœ κ±΄κ°€μš”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

μ •λ ¬λœ μ—¬λŸ¬ 리슀트λ₯Ό ν•˜λ‚˜μ˜ μ •λ ¬λœ 리슀트둜 병합할 λ•Œ μ ν•©ν•œ K-way merge λ°©μ‹μœΌλ‘œ κ΅¬ν˜„ν•΄λ³΄μ•˜μœΌλ‚˜, Collections.sort 방식이 λ²€μΉ˜λ§ˆν¬ν–ˆμ„ λ•Œ 더 λΉ λ₯΄κΈ° λ•Œλ¬Έμ— 이와 같이 μˆ˜μ •ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

벀치마크 μ‹œ μ‚¬μš©ν•œ k-way merge κ΅¬ν˜„ μ½”λ“œμ™€ ν…ŒμŠ€νŠΈ μ½”λ“œλŠ” 링크 μ°Έκ³  λΆ€νƒλ“œλ¦½λ‹ˆλ‹€.

벀치마크 ν…ŒμŠ€νŠΈ κ²°κ³Ό
======================================================================
SMGetResult Merge Algorithm Benchmark
Comparing k-way merge vs Collections.sort
======================================================================

=== Small Dataset ===
Nodes: 5
Elements per node: 100
Total elements: 500
Iterations: 1000

Results:
K-way merge: 39 ms (0.04 ms/iteration)
Collections.sort: 12 ms (0.01 ms/iteration)
Speedup: 0.31x
βœ— Old implementation is faster

=== Medium Dataset ===
Nodes: 10
Elements per node: 500
Total elements: 5000
Iterations: 100

Results:
K-way merge: 39 ms (0.39 ms/iteration)
Collections.sort: 7 ms (0.07 ms/iteration)
Speedup: 0.18x
βœ— Old implementation is faster

=== Large Dataset ===
Nodes: 20
Elements per node: 1000
Total elements: 20000
Iterations: 50

Results:
K-way merge: 94 ms (1.88 ms/iteration)
Collections.sort: 13 ms (0.26 ms/iteration)
Speedup: 0.14x
βœ— Old implementation is faster

=== Very Large Dataset ===
Nodes: 50
Elements per node: 2000
Total elements: 100000
Iterations: 10

Results:
K-way merge: 123 ms (12.30 ms/iteration)
Collections.sort: 13 ms (1.30 ms/iteration)
Speedup: 0.11x
βœ— Old implementation is faster

=== Many Nodes ===
Nodes: 500
Elements per node: 100
Total elements: 50000
Iterations: 50

Results:
K-way merge: 497 ms (9.94 ms/iteration)
Collections.sort: 41 ms (0.82 ms/iteration)
Speedup: 0.08x
βœ— Old implementation is faster

=== Few Nodes Large Elements ===
Nodes: 3
Elements per node: 5000
Total elements: 15000
Iterations: 50

Results:
K-way merge: 24 ms (0.48 ms/iteration)
Collections.sort: 5 ms (0.10 ms/iteration)
Speedup: 0.21x
βœ— Old implementation is faster

======================================================================
Benchmark Complete
======================================================================

Copy link
Collaborator

Choose a reason for hiding this comment

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

κΈ°μ‘΄ λ‘œμ§μ€ unique μ—¬λΆ€, reverse μ—¬λΆ€, count 값에 따라 κ²°κ³Όκ°€ λ‹¬λΌμ§€λŠ” λ‘œμ§μ΄μ—ˆμŠ΅λ‹ˆλ‹€.
μ€‘λ³΅λœ bkeyλŠ” μ œκ±°ν•˜κ³ , reverse이면 μ—­μˆœμœΌλ‘œ μ •λ ¬ν•˜κ³ , count보닀 λ§Žμ€ μ›μ†ŒλŠ” λ°˜ν™˜λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.
ν˜„μž¬ PR은 κΈ°μ‘΄ 둜직과 달리 κ·Έλƒ₯ λͺ¨λ“  κ²°κ³Όλ₯Ό λ‹€ ν¬ν•¨ν•˜κ³  μžˆλŠ”λ°, μœ„μ™€ 같은 λ‘œμ§λ“€μ„ λ‹¨μˆœν™”ν•˜κΈ°λ‘œ κ²°μ •ν•œ 것인지 κΆκΈˆν•©λ‹ˆλ‹€.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

μ•— 이뢀뢄은 μ œκ°€ λ†“μ³€μŠ΅λ‹ˆλ‹€.
count의 κ²½μš°λŠ” bopMultiGetμ—μ„œλ„ SMGetκ³Ό λ™μΌν•˜κ²Œ bkey μ •λ ¬ μˆœμ„œλŒ€λ‘œ μž˜λΌμ„œ λ°˜ν™˜ν•΄μ•Ό ν•  것 같은데 μ–΄λ–»κ²Œ μƒκ°ν•˜μ‹œλ‚˜μš”? (μΌκ΄€λœ 의미λ₯Ό κ°€μ Έμ•Ό ν•œλ‹€λŠ” μƒκ°μž…λ‹ˆλ‹€.)

Copy link
Collaborator

Choose a reason for hiding this comment

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

bopMultiGet의 경우 μ„œλ²„ λ‹¨μ—μ„œ 이미 count에 λ§žμΆ°μ„œ λ°˜ν™˜ν–ˆμœΌλ‹ˆ 문제 μ—†μŠ΅λ‹ˆλ‹€.
smget μ—°μ‚°μ—μ„œ λ¬Έμ œκ°€ λ˜λŠ” 뢀뢄은, 각 μΊμ‹œ μ„œλ²„ λ‹¨μ—μ„œλŠ” count에 λ§žμΆ°μ„œ λ°˜ν™˜μ„ ν–ˆμ§€λ§Œ 이λ₯Ό Clientμ—μ„œ λ³‘ν•©ν•˜λŠ” κ³Όμ •μ—μ„œ count 개수λ₯Ό μ΄ˆκ³Όν•  κ°€λŠ₯성이 μžˆλŠ” λΆ€λΆ„μž…λ‹ˆλ‹€.
예λ₯Ό λ“€μ–΄ count 값이 50인데 μΊμ‹œ μ„œλ²„ 2λŒ€μ—μ„œ λ‘˜ λ‹€ 50개의 μ›μ†Œλ₯Ό λ°˜ν™˜ν–ˆλ‹€λ©΄, Client μž…μž₯μ—μ„œλŠ” 100개의 μ›μ†Œλ₯Ό 받은 κ²ƒμž…λ‹ˆλ‹€.
κ·Έλž˜μ„œ κΈ°μ‘΄ smgetμ—μ„œλŠ” count보닀 λ§Žμ€ μ›μ†Œλ₯Ό λ²„λ¦¬λŠ” λ™μž‘μ΄ μžˆμ—ˆλ˜ κ²ƒμž…λ‹ˆλ‹€.

Copy link
Collaborator

@brido4125 brido4125 left a comment

Choose a reason for hiding this comment

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

btree api PR에 μ „μ²΄μ μœΌλ‘œ μ•„λž˜μ™€ 같은 μ„€λͺ… 덧뢙여 μ£Όμ„Έμš”

  • as-is μƒνƒœμ—μ„œμ˜ λ°˜ν™˜κ°’ / to-be μƒνƒœμ—μ„œμ˜ λ°˜ν™˜κ°’
  • as-is μƒνƒœμ—μ„œμ˜ μ˜ˆμ™Έ μ‹œ λ°˜ν™˜ κ°’ / to-be μƒνƒœμ—μ„œμ˜ μ˜ˆμ™Έ μ‹œ λ°˜ν™˜κ°’

μœ„ 뢀뢄이 λ‚˜μ€‘μ— ν•΄λ‹Ή κΈ°λŠ₯ 릴리즈 ν•  λ•Œ, μ–΄μ°¨ν”Ό μ‚¬μš©μžμ—κ²Œλ„ κ°€μ΄λ“œ λ˜μ–΄μ•Ό ν•  λ‚΄μš©μž…λ‹ˆλ‹€.
λ²ˆκ±°λ‘­λ”λΌλ„ μ§€κΈˆ 미리 μž‘μ„±ν•œλ‹€κ³  μƒκ°ν•˜κ³  ν•΄μ£Όμ‹œλ©΄ κ°μ‚¬ν•˜κ² μŠ΅λ‹ˆλ‹€

@oliviarla
Copy link
Collaborator Author

@brido4125
API λ©”μ„œλ“œλ§ˆλ‹€ javadoc에 λ°˜ν™˜ νƒ€μž…μ— λŒ€ν•œ λ‚΄μš©μ„ μžμ„Ένžˆ μΆ”κ°€ν•΄λ‘μ—ˆμŠ΅λ‹ˆλ‹€.
as-isκ°€ ArcusClient#asyncBop... λ§μ”€ν•˜μ‹œλŠ”κ²Œ λ§žλ‹€λ©΄, μ €λŠ” 이 λ‘˜μ„ λΉ„κ΅ν•˜λ©΄ 였히렀 더 ν—·κ°ˆλ¦΄ 것이라고 μƒκ°ν•©λ‹ˆλ‹€.
λ”°λΌμ„œ ν˜„μž¬ ν˜•νƒœμ—μ„œ λ°˜ν™˜ 값이 μ μ ˆν•œμ§€ λ¦¬λ·°ν•΄μ£Όμ‹œλ©΄ κ°μ‚¬ν•˜κ² μŠ΅λ‹ˆλ‹€. (exception이 λ°œμƒν•˜λŠ” 상황은 λ…Έμ…˜μ— μ •λ¦¬λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.)

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

Successfully merging this pull request may close these issues.

4 participants