{"id":17358202,"url":"https://github.com/filipecosta90/redismodule-sample-cpu-features","last_synced_at":"2026-05-01T15:38:51.918Z","repository":{"id":90626422,"uuid":"319135408","full_name":"filipecosta90/redismodule-sample-cpu-features","owner":"filipecosta90","description":"A cross platform Redis Module Example that warns and uses the optimized functions based on instruction set extensions available and or microarchitecture","archived":false,"fork":false,"pushed_at":"2020-12-07T01:28:23.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T15:53:42.275Z","etag":null,"topics":["avx","cross-platform-redis","microarchitecture","optimized-functions","redis","redis-module","sse4"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/filipecosta90.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}},"created_at":"2020-12-06T21:29:16.000Z","updated_at":"2023-09-23T19:00:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"cb82dcd4-de34-475b-b858-8be3022cad79","html_url":"https://github.com/filipecosta90/redismodule-sample-cpu-features","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/filipecosta90/redismodule-sample-cpu-features","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipecosta90%2Fredismodule-sample-cpu-features","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipecosta90%2Fredismodule-sample-cpu-features/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipecosta90%2Fredismodule-sample-cpu-features/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipecosta90%2Fredismodule-sample-cpu-features/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/filipecosta90","download_url":"https://codeload.github.com/filipecosta90/redismodule-sample-cpu-features/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipecosta90%2Fredismodule-sample-cpu-features/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32503202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["avx","cross-platform-redis","microarchitecture","optimized-functions","redis","redis-module","sse4"],"created_at":"2024-10-15T19:04:43.823Z","updated_at":"2026-05-01T15:38:51.900Z","avatar_url":"https://github.com/filipecosta90.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redismodule-sample-cpu-features\nA cross platform Redis Module that warns and uses the optimized functions based on instruction set extensions available and or microarchitecture.\nIf you can use SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4a, SSE5, AVX, AVX2, AVX-512 and you're not taking advantage of it you'll be warned that these are available on your machine and could speed up CPU computations.\n\n### Example of unoptimized build/runtime\n\n```\nmake \n```\n\n```\n$ redis-server --loadmodule ./cpu_features.so\n232641:C 07 Dec 2020 01:16:55.139 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo\n232641:C 07 Dec 2020 01:16:55.139 # Redis version=255.255.255, bits=64, commit=92ec5925, modified=1, pid=232641, just started\n232641:C 07 Dec 2020 01:16:55.139 # Configuration loaded\n232641:M 07 Dec 2020 01:16:55.142 * Increased maximum number of open files to 10032 (it was originally set to 1024).\n232641:M 07 Dec 2020 01:16:55.142 * monotonic clock: POSIX clock_gettime\n                _._                                                  \n           _.-``__ ''-._                                             \n      _.-``    `.  `_.  ''-._           Redis 255.255.255 (92ec5925/1) 64 bit\n  .-`` .-```.  ```\\/    _.,_ ''-._                                   \n (    '      ,       .-`  | `,    )     Running in standalone mode\n |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379\n |    `-._   `._    /     _.-'    |     PID: 232641\n  `-._    `-._  `-./  _.-'    _.-'                                   \n |`-._`-._    `-.__.-'    _.-'_.-'|                                  \n |    `-._`-._        _.-'_.-'    |           http://redis.io        \n  `-._    `-._`-.__.-'_.-'    _.-'                                   \n |`-._`-._    `-.__.-'    _.-'_.-'|                                  \n |    `-._`-._        _.-'_.-'    |                                  \n  `-._    `-._`-.__.-'_.-'    _.-'                                   \n      `-._    `-.__.-'    _.-'                                       \n          `-._        _.-'                                           \n              `-.__.-'                                               \n\n232641:M 07 Dec 2020 01:16:55.143 # Server initialized\n232641:M 07 Dec 2020 01:16:55.143 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.\n232641:M 07 Dec 2020 01:16:55.144 # \u003csample_cpu_features\u003e The module wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.\n232641:M 07 Dec 2020 01:16:55.144 # \u003csample_cpu_features\u003e The module wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.\n232641:M 07 Dec 2020 01:16:55.144 * Module 'sample_cpu_features' loaded from ./cpu_features.so\n232641:M 07 Dec 2020 01:16:55.144 * Ready to accept connections\n```\n\nPlease notice:\n```\n232641:M 07 Dec 2020 01:16:55.144 # \u003csample_cpu_features\u003e The module wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.\n232641:M 07 Dec 2020 01:16:55.144 # \u003csample_cpu_features\u003e The module wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.\n```\n\n\n\n### Example of optimized build/runtime\n\n```\nmake ARCH_NATIVE=1\n```\n\n```\n$ redis-server --loadmodule ./cpu_features.so\n233097:C 07 Dec 2020 01:22:44.530 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo\n233097:C 07 Dec 2020 01:22:44.530 # Redis version=255.255.255, bits=64, commit=92ec5925, modified=1, pid=233097, just started\n233097:C 07 Dec 2020 01:22:44.530 # Configuration loaded\n233097:M 07 Dec 2020 01:22:44.532 * Increased maximum number of open files to 10032 (it was originally set to 1024).\n233097:M 07 Dec 2020 01:22:44.532 * monotonic clock: POSIX clock_gettime\n                _._                                                  \n           _.-``__ ''-._                                             \n      _.-``    `.  `_.  ''-._           Redis 255.255.255 (92ec5925/1) 64 bit\n  .-`` .-```.  ```\\/    _.,_ ''-._                                   \n (    '      ,       .-`  | `,    )     Running in standalone mode\n |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379\n |    `-._   `._    /     _.-'    |     PID: 233097\n  `-._    `-._  `-./  _.-'    _.-'                                   \n |`-._`-._    `-.__.-'    _.-'_.-'|                                  \n |    `-._`-._        _.-'_.-'    |           http://redis.io        \n  `-._    `-._`-.__.-'_.-'    _.-'                                   \n |`-._`-._    `-.__.-'    _.-'_.-'|                                  \n |    `-._`-._        _.-'_.-'    |                                  \n  `-._    `-._`-.__.-'_.-'    _.-'                                   \n      `-._    `-.__.-'    _.-'                                       \n          `-._        _.-'                                           \n              `-.__.-'                                               \n\n233097:M 07 Dec 2020 01:22:44.534 # Server initialized\n233097:M 07 Dec 2020 01:22:44.534 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.\n233097:M 07 Dec 2020 01:22:44.535 * Module 'sample_cpu_features' loaded from ./cpu_features.so\n233097:M 07 Dec 2020 01:22:44.536 * Ready to accept connections\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilipecosta90%2Fredismodule-sample-cpu-features","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilipecosta90%2Fredismodule-sample-cpu-features","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilipecosta90%2Fredismodule-sample-cpu-features/lists"}