{"id":16615906,"url":"https://github.com/ko1nksm/io","last_synced_at":"2025-06-10T19:41:03.830Z","repository":{"id":124139566,"uuid":"477019939","full_name":"ko1nksm/io","owner":"ko1nksm","description":"io - Summarize I/O resources used by the command (like the time command)","archived":false,"fork":false,"pushed_at":"2023-11-11T11:41:30.000Z","size":4,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-16T09:14:08.280Z","etag":null,"topics":["shell","time"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/ko1nksm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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},"funding":{"github":"ko1nksm"}},"created_at":"2022-04-02T10:21:35.000Z","updated_at":"2024-05-13T14:02:34.000Z","dependencies_parsed_at":"2023-11-11T12:37:33.470Z","dependency_job_id":null,"html_url":"https://github.com/ko1nksm/io","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ko1nksm%2Fio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ko1nksm%2Fio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ko1nksm%2Fio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ko1nksm%2Fio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ko1nksm","download_url":"https://codeload.github.com/ko1nksm/io/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250302606,"owners_count":21408411,"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":["shell","time"],"created_at":"2024-10-12T02:11:12.325Z","updated_at":"2025-04-22T18:49:48.579Z","avatar_url":"https://github.com/ko1nksm.png","language":"Shell","funding_links":["https://github.com/sponsors/ko1nksm"],"categories":[],"sub_categories":[],"readme":"# io - Summarize I/O resources used by the command\n\nThis is I/O version of `time` command and outputs I/O resources used by the command.\n\n## Requirements\n\n- procfs - Linux, etc.\n\nThe measurement results are read from the `/proc/\u003cPID\u003e/io`.\n\n## Usage\n\n```sh\n# $ base64 -w 999 /dev/urandom | head -n 10000 \u003e data.txt\n# $ wc data.txt\n#    10000    10000 10000000 data.txt\n\n$ export IOCLEANUP='sudo sh -c \"echo 1 \u003e /proc/sys/vm/drop_caches\"'\n$ export IOWARMUP='sort --version'\n\n$ io sort data.txt \u003e /dev/null\nio: cleanup: sudo sh -c \"echo 1 \u003e /proc/sys/vm/drop_caches\"\nio: warmup: sort --version\n\nrchar: 10005365\nwchar: 10000000\nsyscr: 124\nsyscw: 2442\nread_bytes: 10002432\nwrite_bytes: 0\ncancelled_write_bytes: 0\n```\n\n**Note**: See also `env time -v \u003cCOMMAND\u003e` (GNU time).\n\n## Environment variables\n\n### IOCLEANUP\n\nSpecifies cleanup commands to be executed before measurement is performed.\nTypically, it specifies a command to clear the cache.\n\n### IOWARMUP\n\nSpecifies the command to be executed before measurement.\nThis is used to preload the command to be executed, etc., into memory in advance.\n\n## Useless Use of Cat\n\nSee https://en.wikipedia.org/wiki/Cat_(Unix)#Useless_use_of_cat\n\n```console\n$ base64 -w 999 /dev/urandom | head -n 1000000 \u003e data.txt\n\n$ export IOCLEANUP='sudo sh -c \"echo 1 \u003e /proc/sys/vm/drop_caches\"'\n$ export IOWARMUP='bash /dev/null; sort --version; cat --version'\n\n$ io bash -c 'time sort data.txt \u003e /tmp/output.txt'\nio: cleanup: sudo sh -c \"echo 1 \u003e /proc/sys/vm/drop_caches\"\nio: warmup: bash /dev/null; sort --version; cat --version\n\nreal    0m4.269s\nuser    0m3.270s\nsys     0m1.699s\n\nrchar: 1000014824\nwchar: 1000000043\nsyscr: 149\nsyscw: 244146\nread_bytes: 1000058880\nwrite_bytes: 1000001536\ncancelled_write_bytes: 0\n\n$ io bash -c 'time cat data.txt | sort \u003e /tmp/output.txt'\nio: cleanup: sudo sh -c \"echo 1 \u003e /proc/sys/vm/drop_caches\"\nio: warmup: bash /dev/null; sort --version; cat --version\n\nreal    0m8.061s\nuser    0m2.720s\nsys     0m4.083s\n\nrchar: 3959315116\nwchar: 3959296043\nsyscr: 548720\nsyscw: 730159\nread_bytes: 1000214528\nwrite_bytes: 2959458304\ncancelled_write_bytes: 1959456768\n```\n\n## Comparison with GNU time\n\n```sh\n$ base64 -w 999 /dev/urandom | head -n 1000000 \u003e data.txt\n\n$ sudo sh -c \"echo 1 \u003e /proc/sys/vm/drop_caches\"\n$ env time -v bash -c 'sort data.txt \u003e /tmp/output.txt'\n        Command being timed: \"bash -c sort data.txt \u003e /tmp/output.txt\"\n        User time (seconds): 3.12\n        System time (seconds): 1.83\n        Percent of CPU this job got: 115%\n        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:04.30\n        Average shared text size (kbytes): 0\n        Average unshared data size (kbytes): 0\n        Average stack size (kbytes): 0\n        Average total size (kbytes): 0\n        Maximum resident set size (kbytes): 1104064\n        Average resident set size (kbytes): 0\n        Major (requiring I/O) page faults: 5\n        Minor (reclaiming a frame) page faults: 275750\n        Voluntary context switches: 3036\n        Involuntary context switches: 38\n        Swaps: 0\n        File system inputs: 1953720\n        File system outputs: 1953128\n        Socket messages sent: 0\n        Socket messages received: 0\n        Signals delivered: 0\n        Page size (bytes): 4096\n        Exit status: 0\n\n$ sudo sh -c \"echo 1 \u003e /proc/sys/vm/drop_caches\"\n$ env time -v bash -c 'cat data.txt | sort \u003e /tmp/output.txt'\n        Command being timed: \"bash -c cat data.txt | sort \u003e /tmp/output.txt\"\n        User time (seconds): 2.83\n        System time (seconds): 4.15\n        Percent of CPU this job got: 85%\n        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:08.15\n        Average shared text size (kbytes): 0\n        Average unshared data size (kbytes): 0\n        Average stack size (kbytes): 0\n        Average total size (kbytes): 0\n        Maximum resident set size (kbytes): 17704\n        Average resident set size (kbytes): 0\n        Major (requiring I/O) page faults: 6\n        Minor (reclaiming a frame) page faults: 5402\n        Voluntary context switches: 39994\n        Involuntary context switches: 36\n        Swaps: 0\n        File system inputs: 1953888\n        File system outputs: 5780192\n        Socket messages sent: 0\n        Socket messages received: 0\n        Signals delivered: 0\n        Page size (bytes): 4096\n        Exit status: 0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fko1nksm%2Fio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fko1nksm%2Fio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fko1nksm%2Fio/lists"}