.NET MAUI (Windows) inference 9× slower than WinForms using LLamaSharp #1249
Unanswered
mfsigauravk
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When running the same LLamaSharp inference code on Windows:
WinForms app: Response time ≈ 10 seconds
.NET MAUI (Windows): Response time ≈ 90+ seconds
The model, parameters, and hardware are the same. Only the UI framework differs.
Steps to reproduce
Create a WinForms app targeting .NET 8.0 or .NET 9.0 on Windows.
Add LLamaSharp and LLamaSharp.Backend.Cpu packages.
Load model + run:
await foreach (var text in executor.InferAsync(prompt, inferenceParams))
{
// consume output
}
Repeat exactly the same code in a .NET MAUI (Windows) project.
Expected behavior
Similar response time (≈10 seconds) on Windows for both WinForms and .NET MAUI apps.
Actual behavior
.NET MAUI (Windows) takes ≈90 seconds or more to produce the same response.
Environment
.NET 9.0
LLamaSharp version: (insert your version)
Windows 10/11 x64
CPU: (insert CPU)
Build configuration: (Debug/Release)
Additional context
Model is loaded once and reused between calls.
Question
Is there a known performance difference between LLamaSharp running in a .NET MAUI (Windows) environment vs a WinForms app?
Any tips for achieving WinForms-level inference speed in MAUI?
Beta Was this translation helpful? Give feedback.
All reactions