News for hackers. Stuff that matters.
Re:SwiftUI Is Convenient, but Slow by alin23 on Saturday August 26, 2023 @03:42PM (#37276135)
Author here! To this day, the app still struggles with sales because of the lag.

Many smart devs tried to help me, and I added some of their recommendations:

    - caching views to a bitmap using Metal
    - trying smaller windows so that less pixels have to be redrawn
Unfortunately nothing made a noticeable difference, this will have to wait until I get a really boring weekend.
Re:SwiftUI Is Convenient, but Slow by emllnd on Saturday August 26, 2023 @03:49PM (#37276201)
Could you add the date of publication to the top of the page on each blog post? (Or year+month.) Looks like they’re there in the blog list, but not on the individual posts?

Would help understand the context on posts that describe tech that has evolved rapidly and probably still will

Re:SwiftUI Is Convenient, but Slow by alin23 on Saturday August 26, 2023 @03:53PM (#37276238)
Does it not appear on the top right for you? https://shots.panaitiu.com/8BvwKN7N
Re:SwiftUI Is Convenient, but Slow by lylejantzi3rd on Saturday August 26, 2023 @04:10PM (#37276416)
It completely disappears on a mobile browser.

https://imgur.com/GgDdUWM

Re:SwiftUI Is Convenient, but Slow by alin23 on Sunday August 27, 2023 @01:04AM (#37279559)
Indeed, I’ll fix that. Thanks!
Re:SwiftUI Is Convenient, but Slow by lylejantzi3rd on Sunday August 27, 2023 @01:59AM (#37279810)
Anytime! I love your blog and I'm a happy Grilla user.
Re:SwiftUI Is Convenient, but Slow by brailsafe on Saturday August 26, 2023 @04:13PM (#37276450)
Is there a reason you're hiding the date on narrow viewports? Seems odd that on my phone it's only visible if I rotate to landscape
Re:SwiftUI Is Convenient, but Slow by alin23 on Sunday August 27, 2023 @01:05AM (#37279566)
Probably just pasted a style from another element and forgot to adjust this specific thing. I’m fix it.
Re:SwiftUI Is Convenient, but Slow by serhack_ on Saturday August 26, 2023 @03:59PM (#37276302)
Very hard to read it, please change the color. Thanks, my eyes
Re:SwiftUI Is Convenient, but Slow by alin23 on Saturday August 26, 2023 @04:07PM (#37276388)
..I prefer to keep it dimmed, in my eyes it does not have the same importance (and brightness) as the article itself.
Re:SwiftUI Is Convenient, but Slow by sumuyuda on Saturday August 26, 2023 @04:10PM (#37276412)
Have you tried switching to AppKit?

Seems like the app doesn’t have a huge amount of UI and could be converted in a few months.

Re:SwiftUI Is Convenient, but Slow by brandonasuncion on Saturday August 26, 2023 @04:49PM (#37276776)
Just curious, but have you tried the `equatable()` modifier?

It's doc description seems to be closer to what you need than the `id()` modifier.

<https://developer.apple.com/documentation/swiftui/view/equat...>

> Prevents the view from updating its child view when its new value is the same as its old value.

Also, https://swiftwithmajid.com/2020/01/22/optimizing-views-in-sw...

Re:SwiftUI Is Convenient, but Slow by praveenperera on Sunday August 27, 2023 @12:52AM (#37279516)
Do you think the new `Observable` macro in iOS 17 would help at all?
Re:SwiftUI Is Convenient, but Slow by DelightOne on Sunday August 27, 2023 @03:55AM (#37280405)
Did you try to use something like TCA? You can scope the stuff you need to exactly only re-render what you need. Otherwise re-render the world on ObservableObject etc. Observable only alleviates the scoping-part a little and does not help with re-render the whole body.

Some things still re-render the world and are VERY slow though (ifs/switch inside ForEach with many rows easily brings app to hard lagging, even if doing everything to prevent it -> makes SwiftUI useless for generic row usecases).