<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>gfx</author_name>
  <author_url>https://blog.hatena.ne.jp/gfx/</author_url>
  <blog_title>Islands in the byte stream (legacy)</blog_title>
  <blog_url>https://gfx.hatenadiary.org/</blog_url>
  <categories>
    <anon>Perl</anon>
  </categories>
  <description>JPerl Advent Calendar 2008 第一日目でも紹介されているように，特殊な方法で宣言した関数*1は定数関数として特別に処理され，コンパイル時に展開される。しかし，定数の展開はコンパイル時にしか行われない。つまり，実行時に呼び出す実体が決まるメソッドでは，たとえ実質的に定数であっても定数の展開は行われない。それでは定数を返すメソッドを定数関数にする意味はないのかというと，実はそうでもない。定数関数は特殊な形式でコンパイルされる*2ので，メソッドとして呼び出しても速い。ベンチマークの結果は以下の通り。 method: 通常のメソッド呼び出し，func: 通常の関数呼び出し，co…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgfx.hatenadiary.org%2Fentry%2F20081224%2F1230098898&quot; title=&quot;定数関数の威力 - Islands in the byte stream (legacy)&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-12-24 15:08:18</published>
  <title>定数関数の威力</title>
  <type>rich</type>
  <url>https://gfx.hatenadiary.org/entry/20081224/1230098898</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
