You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
概要 Railsを開発する上でパフォーマンスを低下させないためのTipsをメモ Tips 実行時間の大きい処理はJobで非同期実行する リクエスト内で複数な処理を実行してしまうと、レスポンスが遅くなりユーザビリティの低下につながります リクエスト内で実行する必要がないものは、ActiveJob等で非同期に実効するか、バッチ処理で定期的に処理するように することでユーザビリティの向上が図れます 条件式判定よりもSQLで絞る 取得してきたデータを1件ずつ条件反映して処理をするよりは、 取得するデータそのものをSQLで絞る方がはるかにパフォーマンスが良くなります ループの中で毎回条件式で反映してしまうと、ループの中で毎回SQLが走ってしまうこともあるので、 パフォーマンスが要求される場合はSQLで絞るか、SQLで絞れる設計にすることをおすすめします Array よりも ActiveRecord:
並列1000コネクションに耐える! Ruby のイベント駆動ライブラリ Rev と EventMachine の HTTPクライアント こんにちは、takada-at です。 Rubyのイベント駆動型ネットワークプログラミングフレームワーク Rev と EventMachine で HTTPクライアントを動かしてみました。 イベント駆動型ネットワークプログラミングフレームワークとは何か説明しだすと難しいですが、一言で言うと、以下のようになります。 # ふつうのフロー駆動型プログラム Net::HTTP.start(host, port){|http| res = http.get(path) #この処理が終わってから } puts "done" #この次の処理が実行される # イベント駆動型プログラム client = Rev::HttpClient::connect(host, port
In order to execute Ruby code as fast as possible, Rubinius has the ability to compile Ruby code all the way down to machine code when it detects that a method is heavily used. In Rubinius, the system that manages this process is its JIT. In today’s post, I’ll be giving an overview of the various players involved in the path that code takes to get from source to machine code. Without further ado,
JRuby - Java powered Ruby implementation Java仮想マシンで動作するRuby「JRuby」はJavaがもっているさまざまな利点を利用できる興味深いプロダクトだが、Javaの欠点もそのまま引き継いでいる。もっとも顕著なのは起動時間が遅いことだ。これはLinuxなどでは特に気になる。一度起動が完了しJITが有効になったあとのJRubyは優れた速度を出すが、起動は遅い。小さいツールを作って利用するようなケースはJRubyは苦手ということになり、「起動が遅い」という悪名高い評判を得ることになる。 JRubyの主要開発者であるCharles Nutter氏がHeadius: JRuby Startup Time TipsにおいてJRubyの起動を高速化するための7つのテクニックを紹介している。いくつかはJRubyに特有のものだが、それ以外はJavaで動作する
オンメモリキャッシュサーバとして druby を試してみた→失敗 - yagihiro outputでなにが起きてるか。 require "drb/drb" front = [] DRb.start_service("druby://:8888", front) puts DRb.uri sleep require "drb/drb" require "benchmark" DRb.start_service there = DRbObject.new_with_uri "druby://:8888" puts Benchmark::CAPTION puts Benchmark::measure { ARGV[0].to_i.times {|i| there << "hello world #{i}" } } 唯一のRMIは there << "hello world #{i}"ここ。th
(this is only for HEAD - old docs are found in the git repo) A Web Server Called Ebb Ebb aims to be a small and fast web server specifically for hosting dynamic Ruby language web applications. It is a binding to libebb Install The Ruby binding is available as a Ruby Gem. It can be install by executing gem install ebb If you want SSL support you must install GnuTLS. Ebb has no other dependencies.
Rails Web アプリケーションをもっと速く こんなストーリーを考えてみます。 あなたは、Railsを学び、アプリケーションを作成し、サービスをインターネットに公開しました。しばらくすると、最初のユーザができます。あなたはとてもハッピーです。そうするうちにユーザが二人増え、十人になり、百人になりました。あなたはハッピーです、ユーザーもみんなハッピーです。 でも、ユーザが千人になり、一万人になり…。といった場合、何が起こるでしょうか? そこで起こるのはアプリケーションへの同時接続数増加によるサービス提供速度の低下です。ユーザ数が一万人を越えてしまうWebサーバに特有の問題は、C10K問題として知られています。 それでなくとも、残念ながらRailsは同様他種フレームワークと比べて、単位時間あたりの処理量が低いことで知られています。その理由は、RailsではRubyが遅くて、NativeTh
Quick notes before things get crazy OK, things might get a little crazy in this blog post so let’s clear a few things up before we get moving. I like the gritty details, and this article in particular has a lot of gritty info. To reduce the length of the article for the casual reader, I’ve put a portion of the really gritty stuff in the Epilogue below. Definitely check it out if that is your thing
By Ilya Grigorik on June 13, 2009 Benchmarking, profiling and debugging are all areas where better tool support could really benefit the Ruby community. Built in benchmark library and extensions such as ruby-prof provide us with a minimal level of introspection to help identify the common bottlenecks, but they still fall short of the available tools for the JVM, or other dynamic runtimes. If you'r
あなたにとって重要なトピックや同僚の最新情報を入手しましょう最新の洞察とトレンドに関する最新情報を即座に受け取りましょう。 継続的な学習のために、無料のリソースに手軽にアクセスしましょうミニブック、トランスクリプト付き動画、およびトレーニング教材。 記事を保存して、いつでも読むことができます記事をブックマークして、準備ができたらいつでも読めます。
UNIX 偏向文書 artu の中で "Measure Before Optimizing" と説く Raymond は, 同時にプロファイラの計測機構 (instrumentation) がもたらすノイズについて注意を促している. 私のプロファイラ信仰に不安が翳を落とす. gprof ノイズはさておき, そもそもプロファイラはどんな仕組みで速度を測っているんだろう. gprof のマニュアル によると, GNU 一族のプロファイラは次のように実装されている: まず "-pg" オプションつきの gcc でソースをコンパイルする. この指示を受けたコンパイラは各関数の冒頭に "mcount" という名前の関数呼出しを加える. リンクする C のランタイムも専用バージョン (gcrt0.o) に差し替わる. このランタイムは裏で profil() 関数を使いタイマを仕掛ける. そのタイマは発
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く