{"id":16572701,"url":"https://github.com/lemire/zone_benchmarks","last_synced_at":"2025-10-29T02:30:17.576Z","repository":{"id":242296699,"uuid":"792492541","full_name":"lemire/zone_benchmarks","owner":"lemire","description":" zone-file parsing benchmark","archived":false,"fork":false,"pushed_at":"2024-06-28T16:18:02.000Z","size":49,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-07T04:57:46.427Z","etag":null,"topics":[],"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/lemire.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}},"created_at":"2024-04-26T19:30:48.000Z","updated_at":"2024-06-28T16:18:06.000Z","dependencies_parsed_at":"2024-06-12T04:41:57.114Z","dependency_job_id":null,"html_url":"https://github.com/lemire/zone_benchmarks","commit_stats":null,"previous_names":["lemire/zone_benchmarks"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemire%2Fzone_benchmarks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemire%2Fzone_benchmarks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemire%2Fzone_benchmarks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemire%2Fzone_benchmarks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lemire","download_url":"https://codeload.github.com/lemire/zone_benchmarks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238758224,"owners_count":19525728,"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":[],"created_at":"2024-10-11T21:28:19.471Z","updated_at":"2025-10-29T02:30:16.985Z","avatar_url":"https://github.com/lemire.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zone_benchmarks\n\nThis is a zone-file parsing benchmark. We measure complete parsing.\n\n## Zone files\n\n\n- The Sweden zone file (small) is available from https://internetstiftelsen.se/en/zone-data/.\n- Major zone files such as .com are available from  https://czds.icann.org/.\n- The root zone can be found at: https://www.iana.org/domains/root/files.\n\n## Docker container\n\nTo ensure that we have a reproducible software setup, we suggest you use Docker. \nMake sure you are running docker or a docker compatible system on your test platform. \nYou do not have to use docker but it makes it easy to ensure that you have the same\ncompiler and dependency. Under Linux, Docker has minimal overhead for computational\ntasks and is thus suitable for benchmarking.\n\nTo enter the Docker shell, while in the project directory, type:\n```\n./run_docker.sh bash\n````\nThe first time you run this command, the image is created which take a few minutes. \nWe are assuming that you have privileged access to the system---as this is useful to\nget performance counters.\n\nMake sure you have a zone file in the current directory prior to entering the container.\n\n## Requirements\n\nIf you use the container, these are taken care of, but otherwise, you need the following:\n\n- Recent C and C++ compilers (Linux or macOS expected).\n- CMake\n- Git\n- Knot (zscanner)\n- Flex\n- Bison\n\n## Running benchmarks\n\n```\ncmake -B build\ncmake --build build\n./build/benchmarks/bench se.zone.txt\n```\n\nExample:\n\n```\n$ ./build/benchmarks/bench se.zone.txt\nBenchmarking file se.zone.txt\nVolume: 1361515551 bytes\nsimdzonehaswell                               :   0.81 GB/s ( 0 %)   2.72 GHz   3.38 c/b  11.90 i/b   3.52 i/c \nsimdzonewestmere                              :   0.73 GB/s ( 0 %)   2.75 GHz   3.78 c/b  13.76 i/b   3.64 i/c \nsimdzonefallback                              :   0.38 GB/s ( 0 %)   2.97 GHz   7.91 c/b  21.76 i/b   2.75 i/c \nknot3.3.4                                     :   0.19 GB/s ( 0 %)   3.16 GHz  17.06 c/b  23.45 i/b   1.37 i/c \n```\n\nNote that the benchmark involves disk access. However, if you have enough memory, we expect that the zone file\nwill remain in disk cache.\n\n## Running just some benchmarks\n\nAn additional string parameter might be used as a filter:\n\n```\n$ ./build/benchmarks/bench se.zone.txt knot\nknot3.3.4                                     :   0.19 GB/s ( 0 %)   3.17 GHz  17.02 c/b  23.45 i/b   1.38 i/c \n```\n\n## Profiling\n\nWithin the image, you can profile the benchmark like so:\n\n```\n/usr/lib/linux-tools/6.8.0-35-generic/perf record ./build/benchmarks/bench se.zone.txt haswell\n/usr/lib/linux-tools/6.8.0-35-generic/perf report\n```\n\nThe result might be as follow:\n```\n  31.60% parse_rrsig_rdata\n  27.97% maybe_take\n  15.28% parse\n```\n\nOr\n\n```                                                                           ◆\n  28.04% maybe_take                                                                                ▒\n  15.31%  parse_ns_rdata                                                                            ▒\n   9.58%  maybe_take_contiguous                                                                     ▒\n   3.29%  parse_rrsig_rdata \n```\n\n## Disk speed and memory\n\nYou may want to check you disk speed:\n\n```\nsudo hdparm -Tt /dev/sda\n```\n\n```\nfree  -h\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemire%2Fzone_benchmarks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flemire%2Fzone_benchmarks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemire%2Fzone_benchmarks/lists"}