Skip to content

Commit 550647b

Browse files
committed
[ExecuTorch] disable text animation in iOS Llama demo app
We observed poor performance during generation, decreasing as the response got longer. Profiling revealed a lot of time spent in CoreAnimation on the main thread, which went away when I disabled this animation. Differential Revision: [D62308551](https://our.internmc.facebook.com/intern/diff/D62308551/) ghstack-source-id: 241388890 Pull Request resolved: #5134
1 parent 9739609 commit 550647b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

examples/demo-apps/apple_ios/LLaMA/LLaMA/Application/ContentView.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,11 @@ struct ContentView: View {
220220
let count = tokens.count
221221
tokens = []
222222
DispatchQueue.main.async {
223-
withAnimation {
224-
var message = messages.removeLast()
225-
message.text += text
226-
message.tokenCount += count
227-
message.dateUpdated = Date()
228-
messages.append(message)
229-
}
223+
var message = messages.removeLast()
224+
message.text += text
225+
message.tokenCount += count
226+
message.dateUpdated = Date()
227+
messages.append(message)
230228
}
231229
}
232230
if shouldStopGenerating {

0 commit comments

Comments
 (0)