{"id":20659316,"url":"https://github.com/iphands/instruction-counts","last_synced_at":"2026-04-17T16:03:00.085Z","repository":{"id":136293467,"uuid":"590323227","full_name":"iphands/instruction-counts","owner":"iphands","description":"Tooling to find instruction and instruction family counts (ie how much SIMD do my bins have) ","archived":false,"fork":false,"pushed_at":"2023-01-21T17:57:18.000Z","size":3156,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-30T23:51:53.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/iphands.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":"2023-01-18T06:21:19.000Z","updated_at":"2023-01-21T04:41:52.000Z","dependencies_parsed_at":"2023-07-24T06:45:51.787Z","dependency_job_id":null,"html_url":"https://github.com/iphands/instruction-counts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iphands/instruction-counts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iphands%2Finstruction-counts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iphands%2Finstruction-counts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iphands%2Finstruction-counts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iphands%2Finstruction-counts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iphands","download_url":"https://codeload.github.com/iphands/instruction-counts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iphands%2Finstruction-counts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31935697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T12:37:54.787Z","status":"ssl_error","status_checked_at":"2026-04-17T12:37:25.095Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-16T18:33:55.785Z","updated_at":"2026-04-17T16:03:00.059Z","avatar_url":"https://github.com/iphands.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# instruction-counts\n\n## What is this\n\nSome simple tooling that can be used to count the number of times various\ninstructions or instruction \"families\" occur in a compiled binary.\n\nThe original use-case was to count/verify how many SIMD instructions are present\nin bins from various Linux distros, gcc versions, bins built with different\ncflags.\n\n## Setup\n\n### Prep the python env\n\n```\n$ make venv/bin/activate\n$ source venv/bin/activate\n(venv) $ pip install -r requirements.txt\n```\n\n### Collect raw stats about bins in /usr/bin, /usr/local/bin\n\n```\n(venv) $ python src/main.py collect\n```\n\n### Fetch mappings files, and (re)build the database\n\n```\n(venv) $ make reset_db\n```\n\n## Usage\n\n### Query data by package\n\n```\n(venv) $ python src/main.py query %/htop\n\nclear-linux-os.noir x86_64\n  /usr/bin/htop\n    mmx: 1367\n    sse: 2358\n    sse2: 1420\n    sse3: 12\n    ssse3: 12\n    sse4.1: 75\n    total: 5244\n\nfedora37.station-lan x86_64\n  /usr/bin/htop\n    mmx: 577\n    sse: 407\n    sse2: 1010\n    total: 1994\n\ndarwin.air.lan x86_64\n  /usr/local/bin/htop\n    mmx: 6576\n    sse: 278\n    sse2: 482\n    sse3: 16\n    sse4.1: 14\n    sse4.2: 2\n    total: 7368\n\ngentoo.cosmo.gcc12 x86_64\n  /usr/bin/htop\n    mmx: 117\n    avx: 928\n    avx2: 11\n    avx512: 679\n    total: 1735\n```\n\n\n### Query data with host filter\n\n```\n# Get all top from a host like gentoo%\n$ python src/main.py query --host gentoo% %top%\n\ngentoo.cosmo.gcc12 x86_64\n  /usr/bin/slabtop\n    mmx: 7\n    avx: 38\n    avx512: 79\n    total: 124\n\ngentoo.cosmo.gcc12 x86_64\n  /usr/bin/top\n    mmx: 16\n    avx: 267\n    avx2: 8\n    avx512: 301\n    total: 592\n...\n\n# Get all packages from a host like darwin%\n$ python src/main.py query --host darwin% %\n\ndarwin.air.lan x86_64\n  /usr/bin/grops\n    mmx: 4243\n    sse: 201\n    sse2: 272\n    sse3: 4\n    ssse3: 1\n    sse4.1: 12\n    total: 4733\n\ndarwin.air.lan x86_64\n  /usr/bin/pic\n    mmx: 4931\n    sse: 590\n    sse2: 3406\n    sse3: 36\n    sse4.1: 7\n    total: 8970\n\ndarwin.air.lan x86_64\n  /usr/bin/troff\n    mmx: 15001\n    sse: 787\n    sse2: 286\n...\n```\n\n### Or use the database directly!\n\n```\n$ sqlite3 data/database.db '.tables'\nbin       instr     op_count  profile\n\n$ sqlite3 data/database.db '.schema instr'\nCREATE TABLE instr(\n    id INTEGER PRIMARY KEY,\n    opcode TEXT NOT NULL UNIQUE,\n    family TEXT,\n    arch TEXT\n    );\n\n$ sqlite3 data/database.db 'SELECT DISTINCT(family) FROM instr'\n\nsse2\nsse\nsse3\nsse4.1\nsse4.2\nmmx\nsse4a\navx512\nmmx+\nssse3\n3dnow!\n3dnow!+\navx\navx2\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiphands%2Finstruction-counts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiphands%2Finstruction-counts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiphands%2Finstruction-counts/lists"}