Giter Club home page Giter Club logo

Comments (5)

jhollida24 avatar jhollida24 commented on May 24, 2024

Hello. I took a quick look at this from the Twitter app and did not see any stack frames with the term "jpeg" or "decode" in them. I've intentionally run this without symbols. Can you provide an Instruments trace or some screenshots with what you are seeing?

Screen Shot 2021-01-11 at 3 53 09 PM

from ios-twitter-image-pipeline.

cltnschlosser avatar cltnschlosser commented on May 24, 2024

Hmm, yeah I can definitely get that. I'll do it tomorrow. One thing is these UIImages are being served to SwiftUI.Images. Maybe SwiftUI is missing an optimization. I can double check if that is the issue too.

from ios-twitter-image-pipeline.

cltnschlosser avatar cltnschlosser commented on May 24, 2024

image

Not pictured is the same stack trace you have. It's on both the main and background threads.

from ios-twitter-image-pipeline.

jhollida24 avatar jhollida24 commented on May 24, 2024

It looks like a tick of a CADisplayLink timer is creating a Core Animation transaction that's kicking this off. I've not used SwiftUI, but in UIKit terms, I suspect the frame the view is being set to a size that does not match the underlying image that has been downloaded (and a contentMode of "fit").

Maybe you can set a breakpoint in setFrame on the view and see where it's being set?

from ios-twitter-image-pipeline.

cltnschlosser avatar cltnschlosser commented on May 24, 2024

Hmm, there is no real setFrame equivalent, but I just tried replacing Image(uiImage: image) with _UIImageView(image: image). and there is no decoding on the main thread, so seems like a bug in SwiftUI.Image.

private struct _UIImageView: UIViewRepresentable {
    private let image: UIImage

    init(image: UIImage) {
        self.image = image
    }

    func makeUIView(context: Context) -> UIImageView {
        return UIImageView()
    }

    func updateUIView(_ uiView: UIImageView, context: Context) {
        uiView.image = image
    }

    typealias UIViewType = UIImageView

}

from ios-twitter-image-pipeline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.