You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Binding: converting a number set of many elements takes seconds and holds the GIL #94
Priority: medium. Deduplicating a number set is quadratic (crates/dynamoxy-py/src/convert.rs, set_to_av calls unique.contains(&number) for each element): set(range(60_000)) takes 3.0 s to convert (0.6 s for 30,000), against 13 ms for a string set of the same size. That item is about 210 KB, which DynamoDB accepts. The conversion runs on the event loop's thread with the GIL held, on both backends, so the loop and every other thread stall. The core's check_set (value/mod.rs) is quadratic too: the whole in-memory put of that set took 6 s, and one of a 60,000-element string set 4.7 s.
Fix: deduplicate with a HashSet (Number is canonical and implements Hash and Eq), and check sets for duplicates the same way.
Found in a review of the library for bugs (fctl session); the fixes that fit in its ten pull requests are #61 to #65, #67 to #70 and #72.
Activity
fix(core): sets of many elements convert and compare in linear time (#…