ptrkstr / Devices

Swift package that contains all devices from https://www.theiphonewiki.com/wiki/Models. Useful when needing to parse machine/device identifier (i.e. iPhone10,1) to device name (iPhone 8).
MIT License
18 stars 4 forks source link

Slow build with massive memory consumption #22

Open gnadrian opened 1 year ago

gnadrian commented 1 year ago

Hi, nice project, but it takes me 127 seconds to build, and memory usage is through the roof while building (see attached screenshot). This on a Macbook Pro M1 Pro with 32GB – i.e. a decent machine.

Presumably this is a failing of the Swift compiler, but have you thought about restructuring your code in some way to try and avoid this?

Screenshot 2023-06-09 at 10 29 48 AM
ptrkstr commented 1 year ago

Hey @gnadrian, thanks for reaching out 👋 You raise a good point; the build optimisation could be improved, maybe through storing the information in CoreData. However I currently don't utilise this package in my projects so don't have the time to work on it.

ptrkstr commented 1 year ago

@gnadrian it's possible that this PR was the cause of it due to it introducing a huge dictionary for fast lookup. https://github.com/ptrkstr/Devices/pull/17/files#diff-509adb9d11c9bcc8e141438d4a0e540a08c21527ead128dc1f1b2ecf913583ce