{"id":28717171,"url":"https://github.com/mihneats1/fastio","last_synced_at":"2025-07-16T04:35:42.610Z","repository":{"id":298057143,"uuid":"998711683","full_name":"MihneaTs1/fastio","owner":"MihneaTs1","description":"High-Performance Buffered Input for C++","archived":false,"fork":false,"pushed_at":"2025-06-09T06:16:33.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-09T07:23:16.325Z","etag":null,"topics":["competitive-coding","competitive-programming","competitive-programming-contests","cpp","cpp17","input"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MihneaTs1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-06-09T06:05:56.000Z","updated_at":"2025-06-09T06:16:36.000Z","dependencies_parsed_at":"2025-06-09T07:38:01.991Z","dependency_job_id":null,"html_url":"https://github.com/MihneaTs1/fastio","commit_stats":null,"previous_names":["mihneats1/fastio"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MihneaTs1/fastio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MihneaTs1%2Ffastio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MihneaTs1%2Ffastio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MihneaTs1%2Ffastio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MihneaTs1%2Ffastio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MihneaTs1","download_url":"https://codeload.github.com/MihneaTs1/fastio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MihneaTs1%2Ffastio/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259914931,"owners_count":22931334,"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","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":["competitive-coding","competitive-programming","competitive-programming-contests","cpp","cpp17","input"],"created_at":"2025-06-15T03:13:30.032Z","updated_at":"2025-06-15T03:13:52.553Z","avatar_url":"https://github.com/MihneaTs1.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastIO: High-Performance Buffered Input for C++\n\nFastIO is a modern, header-only C++ library for extremely fast, buffered input from files or standard input. It is designed for competitive programming, data processing, and any scenario where input speed is critical.\n\n## Features\n\n- **Blazing fast**: Uses a large buffer and minimal parsing overhead for maximum throughput.\n- **Type-safe**: Supports reading `int`, `long long`, `double`, `bool`, `std::string`, `char`, and C-style strings (`char*`) out of the box.\n- **Flexible**: Works with any `FILE*` stream (default: `stdin`).\n- **Modern C++**: Written in C++17, using best practices and zero dependencies beyond the standard library.\n- **Simple API**: One header, one class, one function to read any supported type.\n\n## Usage\n\nInclude the header and use the `FastIO` class:\n\n```cpp\n#include \"fastio.hpp\"\n\nFastIO io;\nint x = io.next\u003cint\u003e();\ndouble y = io.next\u003cdouble\u003e();\nbool b = io.next\u003cbool\u003e();\nstd::string s = io.next\u003cstd::string\u003e();\nchar c = io.next\u003cchar\u003e();\nchar buf[32];\nio.next(buf, sizeof(buf)); // Reads a word into buf (C-style string)\n```\n\nYou can also use a custom file pointer:\n\n```cpp\nFILE* f = fopen(\"input.txt\", \"rb\");\nFastIO io(f);\n// ...\nfclose(f);\n```\n\n## Benchmark\n\nA benchmark is provided in `benchmark.cpp` to compare FastIO's performance for various types:\n\n- Generates large datasets for `int`, `long long`, `double`, `bool`, `std::string`, `char`, and C-style strings (`char*`).\n- Measures throughput (MB/s) and total time to read all values.\n\n### Build and Run with Makefile\n\nA `Makefile` is provided for convenience:\n\n```sh\nmake        # Builds the benchmark executable\nmake run    # Builds and runs the benchmark\nmake clean  # Removes the executable and generated data files\n```\n\n### Manual Build\n\nYou can also build manually:\n\n```sh\ng++ -Ofast -std=c++17 benchmark.cpp -o benchmark\n./benchmark\n```\n\n## License\n\nCopyright (c) Mihnea-Teodor Stoica 2025\n\nThis project is licensed under the MIT License. See the source file headers for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmihneats1%2Ffastio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmihneats1%2Ffastio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmihneats1%2Ffastio/lists"}