Dart Performance vs Go Performance

2,653 views
Skip to first unread message

Richard Eng

unread,
Dec 4, 2014, 11:13:41 PM12/4/14
to cl...@dartlang.org
Has anyone done a performance comparison between Dart and Go? I can't seem to find anything on the web regarding this.

Most everybody is focusing attention on performance between Dart and JavaScript. Yes, Dart is about twice as fast as JavaScript. This is all fine and good.

But on the server side, Dart's real competition is with Go. Why is everyone reluctant to compare the two?

(I lied. There is one benchmark comparison. At TechEmpower, Dart rates 5.2%, while Go rates 33.0%. But the exact details of what is being benchmarked in Dart is absent, so I'm looking for other benchmarks.)

Richard Eng

unread,
Dec 6, 2014, 12:31:26 AM12/6/14
to cl...@dartlang.org
Just to be clear, at TechEmpower, they have 6 server-side test categories. Go beats Dart in 4 of them, so Dart is not consistently bad.

Günter Zöchbauer

unread,
Dec 6, 2014, 7:27:09 AM12/6/14
to cl...@dartlang.org
It looks like the tests are more about server side frameworks than languages itself.

Kevin Moore

unread,
Dec 7, 2014, 6:39:39 PM12/7/14
to Günter Zöchbauer, cl...@dartlang.org
We also have substantial changes queued up for the next run of TechEmpower.


We're excited to see how the numbers change in Round 10.

--
You received this message because you are subscribed to the Google Groups "Dart Server-side and Cloud Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud+un...@dartlang.org.
Visit this group at http://groups.google.com/a/dartlang.org/group/cloud/.

Greg Lowe

unread,
Dec 7, 2014, 9:53:21 PM12/7/14
to cl...@dartlang.org
These are full framework comparisons - so comparing Dart+postgresql vs Go+mysql isn't only a compiler/vm benchmark. Someone will need to implement Dart+mysql, and Go+postgresql for a full picture.

Greg Lowe

unread,
Dec 7, 2014, 10:04:00 PM12/7/14
to cl...@dartlang.org, gzo...@gmail.com
Looking at the code, it appears that the connection pool size is currently set to 256, though this may be overridden somewhere else.

256 is pretty high, for postgresql usually it's recommended to set this at ~2*cores for optimal throughput. For each physical connection, postgresql starts a new backend process, so having to many will definitely reduce throughput.

It may be worth setting this a little higher than 2x due to each isolate having a separate pool which cannot share connections - not 100% sure.


Søren Gjesse

unread,
Dec 8, 2014, 3:08:38 AM12/8/14
to Greg Lowe, cl...@dartlang.org, Günter Zöchbauer
I think most of the benchmarks in the TechEmpower suite are using the same parameters, so if a connection pool size of 256 is used in the Dart code the same constant should be used for other languages/frameworks. Not sure how consistent that is though.

Regards,
Søren Gjesse

---
Søren Gjesse
Software Engineer, Google Denmark
CVR nr. 28 86 69 84

Greg Lowe

unread,
Dec 8, 2014, 5:07:25 PM12/8/14
to cl...@dartlang.org, greg...@gmail.com, gzo...@gmail.com
I've looked at some other framework tests which use postgresql, they don't set their connection pools to 256 (See links below).

I'm not sure what the optimal pool size should be, but assuming that there is one isolate per core, and one pool per isolate, then 2-3 connections per isolate is probably the ideal level.

The problem with using a large number of connections is that Postgresql doesn't virtualise connections at all. So for each connection the server starts a new backend process. It is up to the application to pool connections, or to use an external connection pool like pgbouncer. By default postgresql is configured to only allow a maximum of 100 connections. However for techempower somebody has foolishly increased this to 1000 to get their benchmark to work correctly - they should have used a pool instead. This setting will reduce postgresql performance as well. If I ever find time, I'll see if I can talk them into fixing this. But at the moment, I'd rather spend my limited time on improving the dart postgresql driver, there are some very low hanging fruit that should be able to give it a good bump in performance.

Another point is that there aren't very many postgresql benchmarks in techempower - so it would be nice to see a dart-mysql benchmark for better apples to apples comparisons.

I've opened a bug here - if any one feels like porting the benchmark - perhaps reply to this ticket so James can review it, and send you patch to techempower.



Here's some links to the techempower postgresql configs:

The test called servlet-postgresql-raw appears to be using the resin default of 5 database connections.

https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Java/servlet/src/main/webapp/WEB-INF/resin-web.xml
Reply all
Reply to author
Forward
0 new messages