<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>xuwei</author_name>
  <author_url>https://blog.hatena.ne.jp/xuwei/</author_url>
  <blog_title>xuwei-k's blog</blog_title>
  <blog_url>https://xuwei-k.hatenablog.com/</blog_url>
  <categories>
    <anon>scala</anon>
  </categories>
  <description>問題です。 以下のA2, B2, B3は、細かい定義方法は違うけれど、実際にはほとんど同じ定義ですが、インスタンス毎のサイズ(アロケーションされるメモリの量)、としては、どれが一番効率がいいでしょうか？どれも同じでしょうか？ この問題に完璧に答えられる自信がある人は、この先を読む必要がありません。 package example sealed abstract class A1(val x: Int) case class A2(y: String) extends A1(2) // 実用的には、その他のA1やB1のsub classやobjectも // あるかもしれないが、直接関係ないので…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fxuwei-k.hatenablog.com%2Fentry%2F2024%2F01%2F03%2F105151&quot; title=&quot;Scalaにおける細かいclassの定義方法とインスタンス毎のサイズ - xuwei-k&amp;#39;s blog&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>2024-01-03 10:51:51</published>
  <title>Scalaにおける細かいclassの定義方法とインスタンス毎のサイズ</title>
  <type>rich</type>
  <url>https://xuwei-k.hatenablog.com/entry/2024/01/03/105151</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
