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.
Ubiregi Advent Calendar 2018 の 18 日目です。 ユビレジではたくさんのお客様の大量の POS データをお預かりしており、様々なバッチ処理も実行されています。今回は特定のケースでバッチ処理の一部が 30 分以上かかっていた処理を 14 秒で終わるようにした話について書きたいと思います。前回の Ruby 2.5 の SEGV と闘った話 - @watson1978 の日記 に引き続き DTrace を使った話になります。 はじめに ユビレジでは CSV ファイルでお客様が特定のデータをダウンロードしたりアップロードできる機能があります。CSV ファイルにエクスポートしたり、CSV ファイルから DB に取り込む処理を Worker を起動してバッチ処理しています。 大量のデータを保有しているアカウントと同量のデータを用意して手元の環境で試したところ時間がかかるこ
Ruby 2.1 was released on Christmas 2013 and the tradition followed since with each new version released in the following Christmas, what leads me to believe that Ruby 2.6 will be released next month. So let’s see what’s new in this version of Ruby. UpdateWOW I never imagined that Matz himself would thank me on stage at Rubyconf in his opening keynote and drive this post forward. Thank you Matz for
Why the Lucky Stiff was one of the brightest and most inspiring programmers in activity. He became famous through a series of blogs and through the incredible amount of open-source projects that he maintained over the course of more than seven years. Why’s popularity grew along with the Ruby programming language’s popularity. When the Rails hype took off in 2005, a great number of young developers
Benoit Daloze is a PhD student in Linz, Austria, researching concurrency in Ruby with TruffleRuby for the past several years. He has contributed to many Ruby implementations, including MRI, TruffleRuby and JRuby. He is the maintainer of ruby/spec, a test suite for the behavior of the Ruby programming language. Array and Hash are used in every Ruby program. Yet, current implementations either preve
こんにちは、技術部のフルタイム Ruby コミッタの遠藤(@mametter)です。メリークリスマス。 本日 Ruby 2.5.0 がリリース予定です。いろいろな改善が含まれています。クックパッドからの主な貢献としては、「trace 命令の削除による高速化」や「分岐・メソッドカバレッジの測定のサポート」などがあります。 ユーザから見える改善はいろいろと記事が出てくると思うので、この記事では、「抽象構文木のメモリ管理のリファクタリング」というあまりユーザから見えない改善を紹介してみます。 概要 Ruby のパーサは、NODE という内部的なオブジェクトで構成された抽象構文木を生成します。2.4 までの NODE は GC に管理される普通のオブジェクトでしたが、2.5 からは GC の外で管理するようになりました。これにより、3 つ嬉しいことがあります。 大きなコードのパースが速くなりました
Rubyで書かれたちょっと重たいバッチ処理があって速くする必要があったので、fork(2)とpipe(2)を使ったマルチプロセス化でコアを活かした並列処理に書き直した話します。 以下の記事に詳しく書いてあるので、TL;DRはそちらを見てな? Forking and IPC in Ruby, Part I Forking and IPC in Ruby, Part II なるほどUnixプロセス ― Rubyで学ぶUnixの基礎 - 達人出版会 Threadじゃいかんの? — GILについて 並行プログラミングとしてまず最初に思いつくのはマルチスレッド化ですが、RubyにおいてはGVL(Giant VM lock)があるためマルチコアを活かすことは難しいのです。 ネイティブスレッドを用いて実装されていますが、 現在の実装では Ruby VM は Giant VM lock (GVL) を有し
Ruby 2.5 は引数に &block を書いても速い!!! #megurorb Meguro.rb#10 で「引数に &block を書いても速い!!!」という素晴らしい改善について話してきた。 b.r-l.o の issue で言うとこちら。 Feature #14045: Lazy Proc allocation for block parameters 前提知識 block の呼び出し方 3 パターン block をメソッドで使う場合、大きく分けてこの 3 パターンがあると思う。 # block を引数で受け取って、call で呼ぶ def block_call_with_block_arg(&block) block.call end # block を引数で受け取らずに yield で呼ぶ def yield_without_block_arg yield end # 引数で
この記事は Ruby 2.5.0 preview1 時点のものです。Ruby 2.5 リリース版については http://tmtms.hatenablog.com/entry/2017/12/30/ruby25 を見てください。 Rubyは毎年クリスマスにバージョンアップされます。 今年も問題なければ12/25にRuby 2.5が出ると思います。 https://docs.ruby-lang.org/en/trunk/NEWS.html を元に変更内容を調べてみました。 言語仕様 トップレベル定数参照 rescue/else/ensure 節 文字列内式のRefinement Unicode バージョン 10.0.0 組み込みライブラリ Array#append, #prepend 追加 Dir.children, Dir.each_child 追加 Dir.glob :base オプショ
I'm Kenta Murata, a researcher at Speee Inc. I released the first stable version, 1.0, of PyCall library a few days ago *1. PyCall provides a mechanism to call Python interpreter from Ruby. Using PyCall, you can use Python's famous tools for data science from Ruby in a generic way. In RubyKaigi 2017, that is held on for 3 days from 18th in the next week, I will talk about the current situation of
TL;DR If you've written Ruby, you've heard it before: Use single quoted strings unless you need string interpolation. It makes sense, right? When I instantiate strings using double quotes, the Ruby intepreter has to do extra work to figure out if it needs to perform interpolation. Since extra work means reduced performance, it seems reasonable to avoid double-quoted instantiation unless it's a nec
Hamlコミッターになった RubyKaigi 2015で「Hamlは遅いしメンテされてないので使わない方がいい」と言ったところ、じゃあ自分でメンテして速くしろということになりコミッターになった*1。 当時から2年ごしなのは、当時のHamlのオーナーがあまりアクティブではなく、最近a_matsudaさんがオーナーになったため。 HamlのTemple化・高速化を行った Templeというのは、テンプレートエンジンをパイプライン的に構築するためのフレームワークで、テンプレートエンジン用の中間表現とその最適化エンジンを持つ。実装をTempleベースにすると、SlimやHamlitに使われているような中間表現を使った最適化を適用しやすくなる。 コミット権をもらったので、RubyKaigi 2015でマージされないと言っていたパッチを自分でマージし、コード生成とattributeのコンパイルをTe
Today, I'm pleased to announce that kaminari has it's first major release! Because 1.0.0 has a number of major changes, I would like to summarize the main changes. Support for Old Versions of Ruby and Rails Have Been Dropped In Kaminari 1.0.0, we decided to discontinue support for the following versions: Ruby 1.9.3 JRuby 1.7 Rails 3.2 and 4.0 If you are using one or more of these versions, make su
■ Ruby 2.4 でもビルドできる json-1.8.5 がリリースされた https://github.com/flori/json/issues/303 でリリースされたよ、という通知を受けて気が付いた。 https://rubygems.org/gems/json/versions/1.8.5 2.4 リリースされてから、延々と json-1.8.3 のビルドエラーで死んでいた問題は、Integer Unification に対応した 1.8.5 で解決されるはず。ただ Rails 4.2 については、ActiveSupport の修正も必要なんでこれだけで全てがうまくいくわけではないけど、Rails に関係ないところで発生している多くは解決するはず。 それはともかく、stdlib なライブラリを dependency に追加するのは多くの場合で意味がありません。json 2.x
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く