Skip to Content
ハイパフォーマンスPython 第2版
book

ハイパフォーマンスPython 第2版

by Micha Gorelick, Ian Ozsvald, 中山 光樹
April 2023
Intermediate to advanced
452 pages
7h 21m
Japanese
O'Reilly Japan, Inc.
Content preview from ハイパフォーマンスPython 第2版

1章高性能なPythonを理解する

1章を読めば以下の問いに答えられるようになる
  • コンピュータアーキテクチャの構成要素とは何か?
  • 一般に、構成要素にはどのようなものがあるか?
  • Pythonは下層のコンピュータアーキテクチャをどのように抽象化しているのか?
  • Pythonのコードを最適化するうえでの障壁は何か?
  • パフォーマンスの高いプログラマーになるためには、どのような戦略が必要か?

 プログラミングは、データのビットを移動し、特別な方法で変換して、ある結果を得ることと考えられます。ただし、これらの演算には時間的なコストがかかります。したがって、ハイパフォーマンスプログラミングとは、これらの演算量を最小化することとみなせます。そのために、より効率的なコードを書いてオーバーヘッドを減らしたり、より適切なアルゴリズムを選択して演算を効率化します。

 まずは、コードのオーバーヘッドを軽減することに焦点を当てることで、ビットを動かしている実際のハードウェアについての理解を深めてみましょう。Pythonはハードウェアを直接操作するのではなく抽象化することに重きを置く言語なので、ビット移動のレベルで考えるのは無駄に思えます。しかし、ハードウェア上でビットを移動する最善な方法と、Pythonがビットの移動を抽象化する方法を理解すれば、Pythonで高性能なプログラムを書く第一歩となります。

1.1 コンピュータシステムの基礎

 コンピュータの構成要素は、大きくは「演算装置」「記憶装置」「両者の接続装置」という3つの装置に分けられます。さらに、これらの装置には使ううえで理解しておくべき特性があります。演算装置であれば1秒間に何回の計算ができるのかという特性があり、記憶装置であればどれだけの量のデータを保持し、どれだけ速く読み書きできるのかという特性があり、接続装置であればどれだけ速くデータをある場所から別の場所に移動できるのかという特性があります。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

ハイパフォーマンスPython

ハイパフォーマンスPython

Micha Gorelick, Ian Ozsvald, 相川 愛三
プログラミングC# 第8版

プログラミングC# 第8版

Ian Griffiths, 木下 哲也, 鈴木 幸敏
PythonによるWebスクレイピング 第2版

PythonによるWebスクレイピング 第2版

Ryan Mitchell, 黒川 利明, 嶋田 健志

Publisher Resources

ISBN: 9784873119908Other