Library / SDK
stephenberry/glaze avatar
stephenberry/glaze

Glaze: the benchmark's fastest reader has no other figures, and the reflection feature needs a compiler fork

Extremely fast, in memory, serialization, reflection, and RPC library for C++. JSON, BEVE, BSON, CBOR, CSV, JSONB, MessagePack, TOML, YAML, EETF

3,109 stars298 forksC++MIT

At a glance

What is it?
The C++ serialisation library whose performance table gives its fastest-reading competitor a read number and nothing else, whose ten claimed formats include a template engine and three named by other projects, and whose headline reflection feature requires either a bleeding-edge compiler or a fork of clang maintained by a bank.
Who is it for?
Glaze suits a C++ project that wants to serialise straight to and from object memory without exceptions or runtime type information, because both of those are claimed with the compiler flags that prove them rather than as aspirations. Verify four things first.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 2 days ago.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • stephenberry/glaze3,109 ★ · +78
Star history
Repository2026-09-252026-11-15
stephenberry/glaze3k3.1k

78 Stars in the last 51 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The fastest reader in the table has no other figures

The performance table has three columns and nine libraries, and one row is different in kind from the rest.

| Library | Roundtrip Time (s) | Write (MB/s) | Read (MB/s) | | --- | --- | --- | --- | | Glaze | 1.01 | 1396 | 1200 | | simdjson (on demand) | N/A | N/A | 1163 |

The competitor labelled on demand is given a read figure and nothing at all for the other two columns, and it still comes second on read. So the read column is the only one where the comparison is complete, and the two columns that measure what the library actually does, round-tripping a document and writing one, have no entry for the fastest reader. The readme then explains why in a footnote directly below the table, saying that this library and one other are fine but lose performance heavily when data is not in the expected sequence or keys are missing, and that the problem grows with file size. That is an admission the comparison depends on input shape, which means the headline read number and the two columns that measure the library's actual job are measured on different terms.

The benchmark covers one format while the library claims ten

The format list at the top of the file names ten things, and every one of the nine competitors in the performance table is a JSON library. So the table that justifies the claim of being among the fastest speaks for exactly one of the ten formats, and the other nine, including the binary ones and the two that exist for compatibility with specific databases, are unmeasured on the page. The test itself is not here either: the link under the table points at a separate repository holding the performance test code, which is the right way to make numbers checkable and means the table is a summary rather than something you can run from this source tree, and the write column is the one a reader building a service would most want.

Three of the ten formats belong to other projects and one is not a serialisation format

The list is presented as a flat set of formats, and it is not one. One entry is a binary format belonging to a specific database and is labelled as that database's binary JSON. Another is the other database's equivalent. A third is a binary encoding format whose link does not point at this project's documentation at all but at a separate organisation's repository. And one entry is not a serialisation format in the sense the rest of the list implies: it is a template language for string interpolation, with its own header. So of ten entries, three are formats whose names and designs belong to somebody else, and one is a different category of thing. None of that is a criticism of the library, but it means the list is a capability inventory rather than a taxonomy, and reading it as a claim of interchangeable formats would be a mistake.

The reflection feature needs a compiler fork, and the older path has a stated member limit

The headline is compile-time reflection that needs no metadata and no macros, and the file splits that into two very different stories. The older path works on aggregate-initialisable structs with C++23 reflection across three compilers, and the file shows a compiler-explorer link for it. The newer path is a proposal for C++26, and the supported compilers are listed as a very recent GCC with a reflection flag and a fork of clang maintained by a bank. What the newer path buys is spelled out in five bullets: classes with constructors, virtual functions and inheritance work without being aggregates; enums serialise to strings automatically with no metadata call; there is no cap on the number of struct members; private members are reachable; and there are no compiler-specific hacks. So the older path cannot reach private members and stops at a hundred and twenty-eight members, which is a real constraint rather than a stylistic one, and it is why the newer path is presented as more than a convenience.

Exceptions and runtime type information are claims with flags attached

Two of the highlights are stated as things the library does not need, and each is paired with the compiler flag that proves it.

code
// enums serialise as strings — no glz::meta required
enum class Color { Red, Green, Blue };
Color c = Color::Green;

struct reflect_enums_opts : glz::opts {
   bool reflect_enums = true;
};
auto color_json = glz::write<reflect_enums_opts{}>(c).value_or("error");
// "Green"

That is the difference between a feature list and a testable claim: you can compile the library with both facilities removed and find out, which is the kind of claim a serialisation library in this space rarely makes. It matters for embedded and kernel-adjacent code, and it is rare in a serialisation library. The readme is also candid that a set of helpers which do throw is available for people who want cleaner syntax, which is the right way to present a constraint you cannot remove.

The newest major feature is announced in the same file as likely to change

A note near the top says HTTP support is being added, covering REST servers, clients and websockets, and then says three things about it in three consecutive sentences: the networking side is under active development, it is usable and feedback is wanted, and the API is likely to be changing and improving. That is an honest status report for a feature in progress. It also draws a line the reader has to notice, because the rest of the file makes stability-shaped claims about the core while the HTTP surface is explicitly not one of them. The repository layout matches the split: three of the four example files are about that networking layer rather than about any of the ten formats, including one whose filename appears to have lost its first few characters. That is the least stable part of the library and the only part with worked examples in the repository.

A header-only library with a source directory and a committed benchmark results file

Two things in the repository layout do not match the summary. The highlights say header only, with separate format headers to avoid compilation overhead, and there is indeed an include directory. There is also a source directory beside it, which a header-only description does not account for. And the root contains a markdown file whose name reads as the output of a benchmark run rather than as documentation, committed alongside the source, so the numbers in the readme have a machine-generated companion in the tree, which is unusual and useful in equal measure. The rest of the layout is what you would expect from a C++ project with a build system and a development container: a CMake list, a presets file, benchmark, fuzzing, test, example and utility directories, a documentation build configuration, and a packaging configuration for a Linux distribution, which is the last entry in the tree suggesting the project is packaged for consumption rather than vendored as source.

Editorial conclusion

Glaze suits a C++ project that wants to serialise straight to and from object memory without exceptions or runtime type information, because both of those are claimed with the compiler flags that prove them rather than as aspirations. Verify four things first. The performance table covers one format while the library claims ten, so the numbers speak for JSON and nothing else. The library that tops the read column has no roundtrip or write figures at all, and the table's own footnote says it degrades on unordered input, which most real data is. The standardised reflection that removes the need for metadata needs either a very recent compiler with a flag or a specific fork from another organisation, so the path most people will take is the older one with its documented limits. And the newest major feature, HTTP, is announced in the same file as likely to change.

Frequently asked questions

What is Glaze?

A C++ library for reading and writing serialisation formats directly to and from object memory, described as one of the fastest JSON libraries in the world. It is header only, keeps each format in its own header to avoid compilation overhead, and claims to need neither exceptions nor runtime type information.

Which formats does Glaze support?

Ten entries: JSON, a binary encoding format, CBOR, two database binary JSON formats, CSV, MessagePack, a template language for string interpolation, TOML, YAML, and an external term format. Three of the ten are formats whose designs belong to other projects, and one is a template language rather than a serialisation format.

Do I need C++26 to use Glaze's reflection?

Not for the main path. Aggregate initialisable structs work with C++23 compile-time reflection but need metadata or macros. The proposal for C++26 removes both and additionally handles classes with constructors and inheritance, automatic enum serialisation, private members and any number of struct members, but it requires either a recent GCC with a reflection flag or a specific clang fork from another organisation.

How does Glaze compare with simdjson?

The readme's table gives that library a read throughput figure and marks its roundtrip and write columns as not applicable, with the row labelled on demand. It still comes second on read. A footnote below the table says it and one other competitor lose performance heavily when data is not in the expected sequence or keys are missing, with the problem growing as the file gets larger.

Does Glaze work without exceptions or runtime type information?

The highlights say neither is necessary and give the compiler flag for each as proof. A separate set of helpers that do throw is offered for people who prefer cleaner syntax, which is presented as an alternative rather than as a contradiction.

Is Glaze's HTTP support finished?

No. A note says HTTP support is being added for REST servers, clients and websockets, that the networking side is under active development, that it is usable and feedback is wanted, and that the API is likely to be changing. Three of the four example files in the repository are about that layer.

Official sources

  1. License: MIT
  2. Project website
  3. README
  4. Releases
  5. stephenberry/glaze on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/stephenberry-glaze.svg)](https://hysenlabs.com/projects/stephenberry-glaze)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/stephenberry-glaze.svg)](https://hysenlabs.com/projects/stephenberry-glaze)

Was this useful?