1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Crystalでlibeventが不要になる

Last updated at Posted at 2024-12-04

はじめに

Crystal言語は、Rubyによく似た文法の言語です。
C言語やRust並に高速です。
コンパイル時間は遅い。

Crystalはlibeventに依存する

Crystalで作成した実行ファイルは(特殊な場合を除き)必ず以下の2つのライブラリにリンクされる。

以前はlibpcre2にも必ずリンクされていたが、プルリクエストを送って修正した。

libgcはガベージコレクション用のライブラリである。
libeventは、非同期イベントの通知を行うライブラリで、Fiberの切り替え(ファイルやIOで発生する)に関わっている。

RFC #0009 のマージ

Crystalでは、重要な変更はRFC(request for comments)で議論する慣習である。RFC #0099 では、libeventのかわりに、epoll (Linux、Android) または kqueue (macOS) を直接利用する変更が議論された。WindowsではIOCPが使われるので影響を受けないそうだ。

NightlyのCrystalをインストールして、小さなスクリプトをビルドしてみたところ、確かにlibeventにリンクされなくなったことを確認した。パフォーマンスも向上するらしいです。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?