{"id":28481676,"url":"https://github.com/bigbang1112/minimal-xmlreader","last_synced_at":"2025-08-05T23:19:29.937Z","repository":{"id":184062854,"uuid":"671247464","full_name":"BigBang1112/minimal-xmlreader","owner":"BigBang1112","description":"Lightweight variant of C#'s XmlReader, for those that don't want to waste 6MB of executable binary just to read a few XML lines.","archived":false,"fork":false,"pushed_at":"2025-01-16T01:17:05.000Z","size":68,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-05T00:37:00.713Z","etag":null,"topics":["csharp","dotnet","nativeaot","xml","xmlreader"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BigBang1112.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-26T22:16:34.000Z","updated_at":"2025-06-28T10:08:16.000Z","dependencies_parsed_at":"2025-07-05T00:31:10.826Z","dependency_job_id":"ea4335e5-8a6e-4c9c-b9e4-a9171563f1f6","html_url":"https://github.com/BigBang1112/minimal-xmlreader","commit_stats":null,"previous_names":["bigbang1112/minimal-xmlreader"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/BigBang1112/minimal-xmlreader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigBang1112%2Fminimal-xmlreader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigBang1112%2Fminimal-xmlreader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigBang1112%2Fminimal-xmlreader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigBang1112%2Fminimal-xmlreader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BigBang1112","download_url":"https://codeload.github.com/BigBang1112/minimal-xmlreader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigBang1112%2Fminimal-xmlreader/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268988150,"owners_count":24340806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-05T02:00:12.334Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","nativeaot","xml","xmlreader"],"created_at":"2025-06-07T20:08:13.099Z","updated_at":"2025-08-05T23:19:24.924Z","avatar_url":"https://github.com/BigBang1112.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Minimal XmlReader\n\n[![Nuget](https://img.shields.io/nuget/v/MinimalXmlReader?style=for-the-badge)](https://www.nuget.org/packages/MinimalXmlReader/)\n[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/BigBang1112/minimal-xmlreader?include_prereleases\u0026style=for-the-badge)](https://github.com/BigBang1112/minimal-xmlreader/releases)\n[![Code Coverage](https://img.shields.io/badge/Code%20Coverage-60%25-yellow?style=for-the-badge)](https://github.com/BigBang1112/minimal-xmlreader)\n\nMinimal XmlReader is a simple, lightweight, and fast XML reader for .NET, mainly viable for NativeAOT.\n\n**Official XmlReader uses at least up to 6MB of additional self-contained executable binary size!** This library tries to reduce this size, while also reducing memory usage and improving performance, in case you don't want to do any extra fancy XML reading or validating.\n\n**Beware this is still considered unstable** and on larger XML files this may be still less efficient than the official XmlReader.\n\n## Usage\n\nCurrently, only string input is supported. For reading streams, official XmlReader is more viable.\n\n## Benchmarks\n\nThese benchmarks compare how fast each reader is able to read XML will all the data inside.\n\n### [XmlRpcMethodCall.xml](Examples/XmlRpcMethodCall.xml)\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cmethodCall\u003e\n\u003cmethodName\u003eTrackMania.PlayerChat\u003c/methodName\u003e\n\u003cparams\u003e\n\u003cparam\u003e\u003cvalue\u003e\u003ci4\u003e0\u003c/i4\u003e\u003c/value\u003e\u003c/param\u003e\n\u003cparam\u003e\u003cvalue\u003e\u003cstring\u003ebigbang1112_dev\u003c/string\u003e\u003c/value\u003e\u003c/param\u003e\n\u003cparam\u003e\u003cvalue\u003e\u003cstring\u003eTrackMania.PlayerFinish 237 bigbang1112 0\u003c/string\u003e\u003c/value\u003e\u003c/param\u003e\n\u003cparam\u003e\u003cvalue\u003e\u003cboolean\u003e0\u003c/boolean\u003e\u003c/value\u003e\u003c/param\u003e\n\u003c/params\u003e\n\u003c/methodCall\u003e\n```\n\n#### Results\n\n```\nBenchmarkDotNet v0.14.0, Windows 11 (10.0.22631.3880/23H2/2023Update/SunValley3)\nAMD Ryzen 7 3700X, 1 CPU, 16 logical and 8 physical cores\n.NET SDK 8.0.303\n  [Host]        : .NET 8.0.7 (8.0.724.31311), X64 RyuJIT AVX2 [AttachedDebugger]\n  .NET 8.0      : .NET 8.0.7 (8.0.724.31311), X64 RyuJIT AVX2\n  NativeAOT 8.0 : .NET 8.0.7, X64 NativeAOT AVX2\n\n\n| Method        | Job           | Runtime       | Mean       | Error    | StdDev    | Ratio | RatioSD | Gen0   | Gen1   | Allocated | Alloc Ratio |\n|-------------- |-------------- |-------------- |-----------:|---------:|----------:|------:|--------:|-------:|-------:|----------:|------------:|\n| MiniXmlReader | .NET 8.0      | .NET 8.0      |   759.6 ns |  8.87 ns |   7.86 ns |  1.00 |    0.01 | 0.0267 |      - |     224 B |        1.00 |\n| XmlReader     | .NET 8.0      | .NET 8.0      | 2,479.4 ns | 49.21 ns | 127.02 ns |  3.26 |    0.17 | 1.4420 | 0.0572 |   12071 B |       53.89 |\n|               |               |               |            |          |           |       |         |        |        |           |             |\n| MiniXmlReader | NativeAOT 8.0 | NativeAOT 8.0 | 1,174.3 ns | 10.59 ns |   9.39 ns |  1.00 |    0.01 | 0.0267 |      - |     224 B |        1.00 |\n| XmlReader     | NativeAOT 8.0 | NativeAOT 8.0 | 3,461.0 ns | 66.06 ns |  81.12 ns |  2.95 |    0.07 | 1.4420 | 0.0572 |   12071 B |       53.89 |\n```\n\n### [Random.xml](Examples/Random.xml)\n\n```xml\n\u003croot\u003e\n\t\u003cperson\n\tfirstname=\"Tierney\"\n\tlastname=\"Shirberg\"\n\tcity=\"Port-au-Prince\"\n\tcountry=\"Sao Tome and Principe\"\n\tfirstname2=\"Anallese\"\n\tlastname2=\"Chick\"\n\temail=\"Anallese.Chick@yopmail.com\"\n  /\u003e\n\t\u003crandom\u003e58\u003c/random\u003e\n\t\u003crandom_float\u003e9.873\u003c/random_float\u003e\n\t\u003cbool\u003etrue\u003c/bool\u003e\n\t\u003cdate\u003e1990-09-10\u003c/date\u003e\n\t\u003cregEx\u003ehelloooooooooooooooooooooooooooooo to you\u003c/regEx\u003e\n\t\u003cenum\u003exml\u003c/enum\u003e\n\t\u003celt\u003eLilith\u003c/elt\u003e\n\t\u003celt\u003eCorrey\u003c/elt\u003e\n\t\u003celt\u003eRoslyn\u003c/elt\u003e\n\t\u003celt\u003eMagdalena\u003c/elt\u003e\n\t\u003celt\u003eNinnetta\u003c/elt\u003e\n\t\u003cAnallese\u003e\n\t\t\u003cage\u003e34\u003c/age\u003e\n\t\u003c/Anallese\u003e\n\u003c/root\u003e\n```\n\n#### Results\n\n```\nBenchmarkDotNet v0.14.0, Windows 11 (10.0.22631.3880/23H2/2023Update/SunValley3)\nAMD Ryzen 7 3700X, 1 CPU, 16 logical and 8 physical cores\n.NET SDK 8.0.303\n  [Host]        : .NET 8.0.7 (8.0.724.31311), X64 RyuJIT AVX2 [AttachedDebugger]\n  .NET 8.0      : .NET 8.0.7 (8.0.724.31311), X64 RyuJIT AVX2\n  NativeAOT 8.0 : .NET 8.0.7, X64 NativeAOT AVX2\n\n\n| Method        | Job           | Runtime       | Mean     | Error     | StdDev    | Ratio | RatioSD | Gen0   | Gen1   | Allocated | Alloc Ratio |\n|-------------- |-------------- |-------------- |---------:|----------:|----------:|------:|--------:|-------:|-------:|----------:|------------:|\n| MiniXmlReader | .NET 8.0      | .NET 8.0      | 1.685 us | 0.0153 us | 0.0136 us |  1.00 |    0.01 | 0.1755 |      - |   1.44 KB |        1.00 |\n| XmlReader     | .NET 8.0      | .NET 8.0      | 3.612 us | 0.0718 us | 0.1515 us |  2.14 |    0.09 | 1.5869 | 0.0725 |  12.97 KB |        9.02 |\n|               |               |               |          |           |           |       |         |        |        |           |             |\n| MiniXmlReader | NativeAOT 8.0 | NativeAOT 8.0 | 2.369 us | 0.0195 us | 0.0173 us |  1.00 |    0.01 | 0.1755 |      - |   1.44 KB |        1.00 |\n| XmlReader     | NativeAOT 8.0 | NativeAOT 8.0 | 4.663 us | 0.0900 us | 0.0842 us |  1.97 |    0.04 | 1.5793 | 0.0687 |   12.9 KB |        8.97 |\n```\n\n### [XmlRpcMethodResponseExtreme.xml](Examples/XmlRpcMethodResponseExtreme.xml)\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cmethodResponse\u003e\n\u003cparams\u003e\n\u003cparam\u003e\u003cvalue\u003e\u003carray\u003e\u003cdata\u003e\n\u003cvalue\u003e\u003carray\u003e\u003cdata\u003e\n\u003cvalue\u003e\u003carray\u003e\u003cdata\u003e\n\u003cvalue\u003e\u003carray\u003e\u003cdata\u003e\n\u003cvalue\u003e\u003cstring\u003earray\u003c/string\u003e\u003c/value\u003e\n\u003c/data\u003e\u003c/array\u003e\u003c/value\u003e\n\u003c/data\u003e\u003c/array\u003e\u003c/value\u003e\n\u003c/data\u003e\u003c/array\u003e\u003c/value\u003e\n\u003cvalue\u003e\u003carray\u003e\u003cdata\u003e\n\u003cvalue\u003e\u003carray\u003e\u003cdata\u003e\n\u003cvalue\u003e\u003carray\u003e\u003cdata\u003e\n\u003cvalue\u003e\u003cstring\u003earray\u003c/string\u003e\u003c/value\u003e\n... (1800+ lines more)\n```\n\n#### Results\n\n```\nBenchmarkDotNet v0.14.0, Windows 11 (10.0.22631.3880/23H2/2023Update/SunValley3)\nAMD Ryzen 7 3700X, 1 CPU, 16 logical and 8 physical cores\n.NET SDK 8.0.303\n  [Host]        : .NET 8.0.7 (8.0.724.31311), X64 RyuJIT AVX2 [AttachedDebugger]\n  .NET 8.0      : .NET 8.0.7 (8.0.724.31311), X64 RyuJIT AVX2\n  NativeAOT 8.0 : .NET 8.0.7, X64 NativeAOT AVX2\n\n\n| Method        | Job           | Runtime       | Mean     | Error   | StdDev  | Ratio | RatioSD | Gen0   | Allocated | Alloc Ratio |\n|-------------- |-------------- |-------------- |---------:|--------:|--------:|------:|--------:|-------:|----------:|------------:|\n| MiniXmlReader | .NET 8.0      | .NET 8.0      | 113.2 us | 1.21 us | 1.13 us |  1.00 |    0.01 | 1.9531 |  16.57 KB |        1.00 |\n| XmlReader     | .NET 8.0      | .NET 8.0      | 225.9 us | 2.76 us | 2.58 us |  2.00 |    0.03 | 3.6621 |     30 KB |        1.81 |\n|               |               |               |          |         |         |       |         |        |           |             |\n| MiniXmlReader | NativeAOT 8.0 | NativeAOT 8.0 | 167.3 us | 1.74 us | 1.62 us |  1.00 |    0.01 | 1.9531 |  16.57 KB |        1.00 |\n| XmlReader     | NativeAOT 8.0 | NativeAOT 8.0 | 316.8 us | 2.75 us | 2.44 us |  1.89 |    0.02 | 3.4180 |  29.93 KB |        1.81 |\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigbang1112%2Fminimal-xmlreader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigbang1112%2Fminimal-xmlreader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigbang1112%2Fminimal-xmlreader/lists"}