{"slug": "compared-gemini-3-8-flash-and-gemma-4", "title": "Compared Gemini 3.8 Flash and Gemma 4", "summary": "A developer's side-by-side test found that Google's Gemini 3.8 Flash cloud model produced a faster Rust parsing function than the local Gemma 4 model (gemma-4-26B_q4_0-it.gguf), cutting starts_with calls from 4 per byte to 1 by adding a quoted-string fast path and a match statement. Both generated functions worked correctly, and the developer pasted the Gemini version into their program after paying $0.01 for the output.", "body_md": "Today I wanted to test **Gemini 3.8 Flash** (a cloud model from Google). I decided to compare its output to a local **Gemma 4** model (specifically `gemma-4-26B_q4_0-it.gguf`). I wanted to generate a somewhat complex, performance-tuned **Rust parsing function**.\n\nFirst I tested **Gemma 4**. It used a `while`-loop over the string's bytes, and a state machine. It called `starts_with` several times. The function appears to work correctly, although it would use `starts_with` 4 times over every byte.\n\nNext, I used **Gemini 3.8 Flash** on OpenRouter. It generated the same basic function, but with 2 additional optimizations. It uses a \"fast path\" through quoted strings, and then a `match` before calling `starts_with`. So it uses `starts_with` 1 time for every byte.\n\nBoth functions will work **correctly**; **Gemini 3.8 Flash** used a fast path, and reduced the number of `starts_with` calls from 4 to 1 on each byte. So Gemini 3.8 Flash, for the cost of $0.01, gave me **faster code**. The speed difference may be small, but I pasted the Gemini function into my program.", "url": "https://wpnews.pro/news/compared-gemini-3-8-flash-and-gemma-4", "canonical_source": "https://www.dotnetperls.com/2026_9_17_compared-gemini-38-flash-gemma-4", "published_at": "2026-09-17 07:00:00+00:00", "updated_at": "2026-09-17 13:55:53.893922+00:00", "lang": "en", "topics": ["large-language-models", "ai-tools", "generative-ai"], "entities": ["Gemini 3.8 Flash", "Gemma 4", "Google", "OpenRouter", "gemma-4-26B_q4_0-it.gguf", "Rust"], "alternates": {"html": "https://wpnews.pro/news/compared-gemini-3-8-flash-and-gemma-4", "markdown": "https://wpnews.pro/news/compared-gemini-3-8-flash-and-gemma-4.md", "text": "https://wpnews.pro/news/compared-gemini-3-8-flash-and-gemma-4.txt", "jsonld": "https://wpnews.pro/news/compared-gemini-3-8-flash-and-gemma-4.jsonld"}}