# Redis vs Memcached: source lines of code compared

The Redis vs Memcached comparison on OctoCounts shows side-by-side source line counts for redis/redis and memcached/memcached, counted with the same engine and analysis options on the dates shown in the methodology line: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.

As of 2026-09-16, redis/redis contains 399,112 total lines (279,702 code) across 1,200 files, while memcached/memcached contains 56,768 total lines (41,471 code) across 139 files as of 2026-08-26. redis/redis is about 6.7x the size of memcached/memcached by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

| Metric | [redis/redis](https://octocounts.com/github/redis/redis) | [memcached/memcached](https://octocounts.com/github/memcached/memcached) |
| --- | ---: | ---: |
| Files | 1,200 | 139 |
| Total lines | 399,112 | 56,768 |
| Code lines | 279,702 | 41,471 |
| Comment lines | 75,314 | 8,987 |
| Blank lines | 44,096 | 6,310 |
| Languages counted | 12 | 11 |

Top languages in redis/redis: C (68.2% of code), C Header (11.7% of code), JSON (10.6% of code). Top languages in memcached/memcached: C (74.8% of code), C Header (14.5% of code), Lua (5.4% of code). C, C Header appear in both top language lists; JSON, Module-Definition, Autoconf appear only in redis/redis's top languages; Lua, Perl, Automake appear only in memcached/memcached's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. redis/redis was counted at ref b78a80bd1fe41f6656bf62d34f4ce4fb7e665dae (commit b78a80bd1fe4) on 2026-09-16; memcached/memcached was counted at ref master (commit 2d51e364799b) on 2026-08-26. See the [counting methodology](https://octocounts.com/docs/methodology) for ignored directories and analysis options.
## About this comparison

redis/redis counts the Redis repository — the in-memory data structure server in C, including its bundled dependencies, tests, and utilities. memcached/memcached counts the Memcached repository — the in-memory key-value cache daemon in C, a more focused single-purpose codebase. Both counts are C server trees, but Redis's includes a broader feature surface and bundled third-party code.

Redis' counted tree includes a deps directory of bundled third-party C libraries it builds against, which the per-language table reflects as additional C beyond the server code itself; Memcached's tree has no comparable bundled-dependency footprint.

The scope difference is architectural: Redis implements multiple data structures and server features in one repository, while Memcached implements one focused caching protocol — so the totals measure different breadths of responsibility.

_The larger tree does not say which is faster or more suitable as a cache: throughput and latency depend on the workload, the deployed version, and the client — not on how many lines each repository contains._

Sources: [redis/redis repository](https://github.com/redis/redis) · [memcached/memcached repository](https://github.com/memcached/memcached). Statements verified 2026-09-16.

Evidence and next steps:

- [redis/redis SLOC report](https://octocounts.com/github/redis/redis)
- [memcached/memcached SLOC report](https://octocounts.com/github/memcached/memcached)
- [Compare redis/redis and memcached/memcached interactively](https://octocounts.com/compare?left=https%3A%2F%2Fgithub.com%2Fredis%2Fredis&right=https%3A%2F%2Fgithub.com%2Fmemcached%2Fmemcached)

Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.

## Compare FAQ

### Which has more lines of code, redis/redis or memcached/memcached?

redis/redis has more code: 279,702 code lines versus 41,471 for memcached/memcached, about 6.7x as much, based on cached OctoCounts reports as of 2026-09-16.

### Does more source lines of code mean more complexity?

Not necessarily. SLOC measures size, not complexity, quality, or maintainability. A larger codebase can mean more features, more generated or vendored code, more verbose language idioms, or more tests — none of which imply the code is harder to work with. Use SLOC to gauge the scale of what you'd be reading or maintaining, not as a quality signal for redis/redis, memcached/memcached, or any repository.

### How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. redis/redis was counted at ref b78a80bd1fe41f6656bf62d34f4ce4fb7e665dae (commit b78a80bd1fe4) on 2026-09-16; memcached/memcached was counted at ref master (commit 2d51e364799b) on 2026-08-26. See the counting methodology for ignored directories and analysis options.

### Can I compare a different branch, tag, or commit?

Yes. This page shows the default branch for each repository. Use the interactive comparison tool to pick any public GitHub repository, branch, tag, or commit SHA for both sides and get a fresh side-by-side report.

## Related OctoCounts pages

- [Interactive repository comparison](https://octocounts.com/compare)
- [Recently analyzed repositories](https://octocounts.com/recent)
- [Popular SLOC reports](https://octocounts.com/popular)
- [Trending GitHub repositories](https://octocounts.com/trending)
- [Hall of Monoliths](https://octocounts.com/hall-of-monoliths)
- [Original research: how filtering changes SLOC counts](https://octocounts.com/research)
- [GitHub SLOC counter guide](https://octocounts.com/docs/github-sloc-counter)
- [Counting methodology](https://octocounts.com/docs/methodology)
- [SLOC and code metrics glossary](https://octocounts.com/docs/glossary)
- [OctoCounts API docs](https://octocounts.com/docs/api)
