mac-cain13 / R.swift

Strong typed, autocompleted resources like images, fonts and segues in Swift projects
MIT License
9.49k stars 764 forks source link

R.Swift grinds Xcode to a hault when file is selected #725

Open philosopherdog opened 3 years ago

philosopherdog commented 3 years ago

We're using R.Swift for localized strings. When I select the file Xcode beach balls and becomes unresponsive for like 5 minutes. I need to solve this issue.

philosopherdog commented 3 years ago

Incidently the file is 28_000+ lines.

ndemie commented 2 years ago

I'm running in to the same issue ever since upgrading to the 2021 MBP with M1 chip

nashfive commented 2 years ago

Not sure if this can be "solved" by code. I mean, yeah reducing the number of lines would help, but if you have a lot of translations, then it's impossible to reduce the size of the file. My generated file is "only" 718Ko, 13'000+ lines and it's already slowing/freezing Xcode during at least a minute...

philosopherdog commented 2 years ago

Hmm. Actually I'm noticing with Xcode 13.2.1 I can select the file again without any issues. I'm on an M1 Max.

gwk commented 2 years ago

I'm working on a project where the generated file is 36k+ lines long. It is creating rather serious usability problems. On an M1 Max it takes 45 seconds for quick open to stop beach balling on R.generated.swift.

One minor improvement would be to split the substructures into different generated files, e.g. R.segue, R.storyboard, R.color, etc. This would still leave us with a 30k R.strings.generated.swift (or whatever the naming convention would be), but it would at least make visiting the other types less of a disaster.

Another step might to split the strings up into multiple files, but I'm not sure.

nicolasvergoz commented 2 years ago

I'm agree with @gwk about splitting the files. Maybe as a boolean option false by default