<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-24611184.post422667555424928681..comments</id><updated>2008-12-03T15:28:18.658-08:00</updated><category term='xml'/><category term='scala'/><category term='podcast'/><category term='StAX'/><category term='java'/><category term='programming'/><category term='jdo'/><category term='socialnetworks'/><category term='gwt'/><category term='monitoring'/><category term='open source'/><category term='Thrift'/><category term='linkedin'/><category term='javaposse'/><category term='protobuf'/><category term='Google App Engine'/><category term='test'/><category term='guic'/><category term='guice'/><category term='ibm'/><category term='groovy'/><category term='spring'/><category term='twitter'/><category term='OHF'/><category term='Eclipse'/><category term='Mac'/><category term='voldemort'/><category term='kaching'/><category term='testing'/><category term='j2ee'/><category term='work'/><category term='conferences'/><category term='xstream'/><category term='json'/><category term='Books'/><title type='text'>Comments on Wondering around: Is object creation is Scala really faster then Jav...</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.eishay.com/feeds/422667555424928681/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24611184/422667555424928681/comments/default'/><link rel='alternate' type='text/html' href='http://www.eishay.com/2008/12/is-object-creation-is-scala-really.html'/><author><name>Eishay Smith</name><uri>http://www.blogger.com/profile/09443096006184006852</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_O9TJAb-LjDE/S44K61181wI/AAAAAAAAAj0/oYGO2xz_kf4/S220/eishay.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-24611184.post-9180847937310119648</id><published>2008-12-03T15:28:00.000-08:00</published><updated>2008-12-03T15:28:00.000-08:00</updated><title type='text'>There have been a number of benchmarks using Scala...</title><content type='html'>There have been a number of benchmarks using Scala's immutable collections vs. the java.util.* collections.  Turns out that for most real-world data sets, immutable collections work better.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24611184/422667555424928681/comments/default/9180847937310119648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24611184/422667555424928681/comments/default/9180847937310119648'/><link rel='alternate' type='text/html' href='http://www.eishay.com/2008/12/is-object-creation-is-scala-really.html?showComment=1228346880000#c9180847937310119648' title=''/><author><name>David Pollak</name><uri>http://www.blogger.com/profile/16630520857988769066</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.eishay.com/2008/12/is-object-creation-is-scala-really.html' ref='tag:blogger.com,1999:blog-24611184.post-422667555424928681' source='http://www.blogger.com/feeds/24611184/posts/default/422667555424928681' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-20232623'/></entry><entry><id>tag:blogger.com,1999:blog-24611184.post-5817989509751335804</id><published>2008-12-02T09:57:00.000-08:00</published><updated>2008-12-02T09:57:00.000-08:00</updated><title type='text'>Also note that not all objects have the same initi...</title><content type='html'>Also note that not all objects have the same initialisation costs, so just counting the number of objects is not good enough. An ArrayList creates an internal array with 10 elements if you invoke the default constructor, for example.&lt;BR/&gt;&lt;BR/&gt;The only way to compare would be to create the same classes in Java and Scala and then benchmark object creation. You will not find a difference then because the bytecode will be very similar (if not the same).</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24611184/422667555424928681/comments/default/5817989509751335804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24611184/422667555424928681/comments/default/5817989509751335804'/><link rel='alternate' type='text/html' href='http://www.eishay.com/2008/12/is-object-creation-is-scala-really.html?showComment=1228240620000#c5817989509751335804' title=''/><author><name>Ismael Juma</name><uri>http://www.blogger.com/profile/17398483226873559286</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.eishay.com/2008/12/is-object-creation-is-scala-really.html' ref='tag:blogger.com,1999:blog-24611184.post-422667555424928681' source='http://www.blogger.com/feeds/24611184/posts/default/422667555424928681' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2084065487'/></entry><entry><id>tag:blogger.com,1999:blog-24611184.post-7798997292094242615</id><published>2008-12-02T09:54:00.000-08:00</published><updated>2008-12-02T09:54:00.000-08:00</updated><title type='text'>Thanks @jau I'll fix it and update the results.&lt;br...</title><content type='html'>Thanks @jau I'll fix it and update the results.&lt;BR/&gt;@Ismael I agree, there is much more going on there then plain old object creation. I did worm up the JIT and tried to avoid GC, but you're right about micro benchmarking. In the Java side I counted about five object creation, not including a couple of ArrayList internal objects. The strings are interned by the JVM so I didn't count them. On that machine it takes about &lt;A HREF="http://eishay.blogspot.com/2008/11/small-perspective.html" REL="nofollow"&gt;7nano to create an object&lt;/A&gt; hence only ~60n out of 323n where spent on object creation. The rest of 260n where spent on the rest (methods, passing references etc). I'll try removing the extra if(), but I guess its insignificant. Arguably Scala actually creates more objects since each list.add() creates a new list and every primitive is an object though is probably compiled to a primitive if there is no reason to make an object out of it.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24611184/422667555424928681/comments/default/7798997292094242615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24611184/422667555424928681/comments/default/7798997292094242615'/><link rel='alternate' type='text/html' href='http://www.eishay.com/2008/12/is-object-creation-is-scala-really.html?showComment=1228240440000#c7798997292094242615' title=''/><author><name>Eishay Smith</name><uri>http://www.blogger.com/profile/09443096006184006852</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_O9TJAb-LjDE/SSHEkczXfAI/AAAAAAAAAPg/DAa6AP088sE/S220/eishay_3_s.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.eishay.com/2008/12/is-object-creation-is-scala-really.html' ref='tag:blogger.com,1999:blog-24611184.post-422667555424928681' source='http://www.blogger.com/feeds/24611184/posts/default/422667555424928681' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1856236024'/></entry><entry><id>tag:blogger.com,1999:blog-24611184.post-3667894384290918995</id><published>2008-12-02T04:36:00.000-08:00</published><updated>2008-12-02T04:36:00.000-08:00</updated><title type='text'>One obvious thing: In the Java code addImage() has...</title><content type='html'>One obvious thing: In the Java code addImage() has an extra if(). How about adding an initializer to the definition of the images field?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24611184/422667555424928681/comments/default/3667894384290918995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24611184/422667555424928681/comments/default/3667894384290918995'/><link rel='alternate' type='text/html' href='http://www.eishay.com/2008/12/is-object-creation-is-scala-really.html?showComment=1228221360000#c3667894384290918995' title=''/><author><name>Itay Maman</name><uri>http://www.blogger.com/profile/15900841850889743147</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.eishay.com/2008/12/is-object-creation-is-scala-really.html' ref='tag:blogger.com,1999:blog-24611184.post-422667555424928681' source='http://www.blogger.com/feeds/24611184/posts/default/422667555424928681' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1396873789'/></entry><entry><id>tag:blogger.com,1999:blog-24611184.post-2103558999738566068</id><published>2008-12-02T03:19:00.000-08:00</published><updated>2008-12-02T03:19:00.000-08:00</updated><title type='text'>Well, this doesn't show that object creation in Sc...</title><content type='html'>Well, this doesn't show that object creation in Scala is faster than Java. At best it says that scala.List is faster than java.util.ArrayList for this particular benchmark. However, I haven't looked at the actual benchmark runner, so there could be many other factors at play (micro-benchmarking in the JVM is hard and it's easy to make mistakes).&lt;BR/&gt;&lt;BR/&gt;Ismael</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24611184/422667555424928681/comments/default/2103558999738566068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24611184/422667555424928681/comments/default/2103558999738566068'/><link rel='alternate' type='text/html' href='http://www.eishay.com/2008/12/is-object-creation-is-scala-really.html?showComment=1228216740000#c2103558999738566068' title=''/><author><name>Ismael Juma</name><uri>http://www.blogger.com/profile/17398483226873559286</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.eishay.com/2008/12/is-object-creation-is-scala-really.html' ref='tag:blogger.com,1999:blog-24611184.post-422667555424928681' source='http://www.blogger.com/feeds/24611184/posts/default/422667555424928681' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2084065487'/></entry><entry><id>tag:blogger.com,1999:blog-24611184.post-4534483882087581142</id><published>2008-12-02T00:49:00.000-08:00</published><updated>2008-12-02T00:49:00.000-08:00</updated><title type='text'>_imags = image :: _images</title><content type='html'>_imags = image :: _images</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24611184/422667555424928681/comments/default/4534483882087581142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24611184/422667555424928681/comments/default/4534483882087581142'/><link rel='alternate' type='text/html' href='http://www.eishay.com/2008/12/is-object-creation-is-scala-really.html?showComment=1228207740000#c4534483882087581142' title=''/><author><name>jau</name><uri>http://www.blogger.com/profile/09019915478026785150</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.eishay.com/2008/12/is-object-creation-is-scala-really.html' ref='tag:blogger.com,1999:blog-24611184.post-422667555424928681' source='http://www.blogger.com/feeds/24611184/posts/default/422667555424928681' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2015625264'/></entry></feed>
