gem 'popcount', '1.0.0'

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

gem 'popcount', '1.0.0'

YAPC::Tokyo 2026
即席LTワークショップ

Kazunori Jo

November 29, 2026

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

24 slides
  1. itochan • いとおちゃん @i315chan • 城 一統 / Kazunori Jo

    • 株式会社IVRy • モバイルアプリエンジニア
  2. popcount とは • 立っているビット(1 のビット)の数を数える操作 • 例: 0b1011 → 3

    • 使いどころ: ビットセット/ビットマップの要素数、ハミング距離 ((a ^ b).popcount)、Bloom lter、チェスなどのビットボード、 類似度検索など fi • 多くの CPU には専用命令がある→x86 の POPCNT、ARM の CNT

More Decks by Kazunori Jo

Other Decks in Programming