並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 3 件 / 3件

新着順 人気順

c++の検索結果1 - 3 件 / 3件

  • [速習] 配列から欠けている数字を見つける「XORトリック」の深い理論と実践 - Qiita

    皆さんは『配列から欠けている数字を見つけろ』と言われたら、どう答えますか? 多くの方は「HashSetで解けばいい」と考えるでしょう。しかし、1000万個の要素で実測したところ、Pythonのsetは945MBもの追加メモリを消費し、処理に2.3秒かかりました。一方、XORを使った解法は追加メモリゼロ、C言語なら1ミリ秒で完了します。 なぜこれほどの差が生まれるのか? XORには単なるトリック以上の深い理論があり、配列の欠損値検出だけでなく、RAID 5のデータ復元やネットワークのエラー検出など、実務で幅広く応用されているのです。 追記: ネットワーク転送時のパケットロスやノイズによるデータ欠損、さらには宇宙線がメモリに衝突してビットが反転する「ソフトエラー」により、配列から要素が失われることがあります。 本記事では、Florian Hartmannの「That XOR Trick」1を基

      [速習] 配列から欠けている数字を見つける「XORトリック」の深い理論と実践 - Qiita
    • Reflections on 2 years of CPython’s JIT Compiler: The good, the bad, the ugly

      Reflections on 2 years of CPython’s JIT Compiler: The good, the bad, the ugly 5 July 2025 This blog post includes my honest opinions on the CPython JIT. What I think we did well, what I think we could have done better. I’ll also do some brief qualititative analysis. I’ve been working on CPython’s JIT compiler since before the very start. I don’t know how long that is at this point … 2.5, maybe alm

      • Building the Rust compiler with GCC

        Bootstrapping Rust with GCC If you know one thing about me, it is that I love working on the Rust compiler. Some people kayak, travel or play guitar - and I stare at assembly, trying to figure out what I broke. This summer, I am taking on quite a large task: bootstrapping the Rust compiler using `cg_gcc` What does that mean? "bootstrapping" is simply a name given to the Rust compiler build process

        1