最近は協力プレイやPvPなどの「リアルタイムサーバー」を書くときは Go が主流になっているのですが、 Tornado を使ったシステムも健在です。 (以前の記事) 数人〜十数人程度の「部屋」を、1つの Tornado プロセスに複数もたせ、さらに一台のサーバーにその Tornado プロセスを複数置くことでCPUのマルチコアを活用する構成になっているのですが、最近各プロセスがログファイルを書く部分でブロックして応答性能が悪化するケースがあったので対策しました。 この記事ではその対策で行ったチューニングや、行わなかったチューニングについても紹介します。 ※なお、この記事は Tornado を題材にしていますが、似たような仕組みになっている node.js などの他の言語のフレームワークでも同じ事が言えるはずです。 前提知識 Tornado は epoll や select などのIO多重化
The Intel® Distribution for Python* provides: Scalable performance using all available CPU cores on laptops, desktops, and powerful servers Support for the latest CPU instructions Near-native performance through acceleration of core numerical and machine learning packages with libraries like the Intel® oneAPI Math Kernel Library (oneMKL) and Intel® oneAPI Data Analytics Library Productivity tools
No time to read the whole thing? Get an instant summary of this article, powered by 🤖 ChatGPT. Python has grown into one of the most versatile and beloved programming languages in the world – thanks in large part to a vibrant, global community of innovators. This includes contributors to CPython, pioneers of iconic libraries like Flask, NumPy, and Pandas, open-source maintainers shaping best prac
背景 Google APIの利用について、GoogleのユーザーIDとパスワードでのアクセスが2015年5月に禁止された。現在はOAuth2.0を利用してアクセスしなければならない。PythonからOAuth2.0での認証に関して、意外と情報が少なく手間取ったのでやり方を残しておく。 本記事はスプレッドシートに関してのものだが、gdataライブラリを利用する他のAPIにも同じように認証が可能なのではないかと思う(未確認)。 環境 python 2.7.5 MacOS X 10.9.5 OAuth2.0での認証方法 OAuth2.0での認証のためには、いくつか準備しなければいけないことがある。 順番に手順を残しておく。 1. Drive APIの有効化 スプレッドシートは、Google Apps APIのDrive APIを利用して操作することになるので、以下の操作で必要なAPIを有効にする
We recently reduced CPU usage across our fleet by 80%. One key technique that made this possible was a lightweight profiling strategy that we could run in production. This post is about the ways we approached instrumentation, the tradeoffs involved, and some tools you can use to optimize your own apps (including code!). Background Nylas is a developer platform that provides APIs to integrate with
All packages pdoc module Module pdoc provides types and functions for accessing the public documentation of a Python module. This includes modules (and sub-modules), functions, classes and module, class and instance variables. Docstrings are taken from modules, functions and classes using the special __doc__ attribute. Docstrings for variables are extracted by examining the module's abstract synta
Pythonの高速化技法について一歩踏み込んだプロユースの解説書。ボトルネックの測定方法から、最適なデータ構造の使い分け、CythonやPyPyなどのコンパイラの比較、numpyなどのパッケージの使い方、マルチコアCPUの活用法、メモリ効率を劇的に改善するトライ構造や近似計算まで、シンプルな実例プログラムを用いながらわかりやすく説明します。高性能なプログラムの書き方だけでなく、高性能なシステムの作り方を総合的に学ぶことができるPythonエキスパート必携の一冊です。 翻訳者の相川氏のブログには、本書の追加情報や関連する技術情報が掲載されています。 訳者まえがき まえがき 1章 高性能なPythonを理解する 1.1 コンピュータシステムの基礎 1.1.1 演算装置 1.1.2 記憶装置 1.1.3 接続レイヤ 1.2 基本要素を統合する 1.2.1 理想計算とPython仮想マシン 1.3
Lasagne is a lightweight library to build and train neural networks in Theano. Its main features are: Supports feed-forward networks such as Convolutional Neural Networks (CNNs), recurrent networks including Long Short-Term Memory (LSTM), and any combination thereof Allows architectures of multiple inputs and multiple outputs, including auxiliary classifiers Many optimization methods including Nes
>>> timeit.timeit("'x' in ('x',)")0.04869917374131205>>> timeit.timeit("'x' == 'x'")0.06144205736110564 >>> timeit.timeit("'x' in ('x', 'y')")0.04866674801541748>>> timeit.timeit("'x' == 'x' or 'x' == 'y'")0.06565782838087131>>> timeit.timeit("'x' in ('y', 'x')")0.08975995576448526>>> timeit.timeit("'x' == 'y' or 'x' == 'y'")0.12992391047427532
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く