Hi,<br><br>Just curies,<br>What does &quot;79 times slower&quot; mean? Does it mean that when Rails-dev has processed 1 transaction Yesod did 79? <br><br>Best regards.<br><br><br><br>BTW: Saying that RoR is 79 times slower would indicate that Yesod is slow, but RoR is (79 times) slower. <br>
<br><br><div class="gmail_quote">On 28 March 2011 14:31, Sven Koschnicke (GFXpro) <span dir="ltr">&lt;<a href="mailto:s.koschnicke@gfxpro.com">s.koschnicke@gfxpro.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello,<br>
<br>
I tested again with persistent-postgresql 0.4.0.1 and now the results are what you would expect :) rails in dev mode is now 79 times slower[1]. Of course, thats not a fair compare, but Greg did some testing with rails production already. Thanks for improving that so quickly!<br>

<br>
Greetings<br>
  Sven<br>
<br>
[1] <a href="https://github.com/SKoschnicke/performance-test" target="_blank">https://github.com/SKoschnicke/performance-test</a><div><div></div><div class="h5"><br>
<br>
On 03/25/2011 08:41 AM, Michael Snoyman wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Sven,<br>
<br>
Can I ask you to try things out one more time, this time with<br>
persistent-postgresql 0.4.0.1? I think I fixed some more of the<br>
issue[1].<br>
<br>
Thanks,<br>
Michael<br>
<br>
[1] <a href="http://docs.yesodweb.com/blog/improving-persistent-performance" target="_blank">http://docs.yesodweb.com/blog/improving-persistent-performance</a><br>
<br>
On Wed, Mar 23, 2011 at 9:23 AM, Sven Koschnicke (GFXpro)<br>
&lt;<a href="mailto:s.koschnicke@gfxpro.com" target="_blank">s.koschnicke@gfxpro.com</a>&gt;  wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Great that you found a way to speed things up! I&#39;m looking forward to the<br>
blog post. I will run some more tests with the improved code, just let me<br>
know when its available. Is someone working on improving the postgres<br>
database backend? Maybe I could help there, the bad performance with<br>
postgres is really a showstopper for me.<br>
<br>
Sven<br>
<br>
On 03/23/2011 08:13 AM, Michael Snoyman wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
This was a great example of a performance bug being exactly where you<br>
don&#39;t expect it. I&#39;m planning on writing up a blog post on this<br>
adventure later, but for the quick summary: the Criterion benchmarks<br>
have gone from 23.7ms (== 23,700us) to 141us. Meaning this is a 200<br>
fold speedup for some operations. This came from switching a large<br>
monad transformer stack to a single RWS monad. But more on that in the<br>
blog post.<br>
<br>
I&#39;ve run your test a few more times: it still seems like there&#39;s a<br>
slowdown from the database code, but I think the widget performance<br>
bug was the big issue. After some more testing on my end, I&#39;ll put the<br>
code on Hackage. Would you give the test another shot after that?<br>
<br>
Thanks again for bringing this up!<br>
<br>
Michael<br>
<br>
On Mon, Mar 21, 2011 at 5:41 PM, Sven Koschnicke (GFXpro)<br>
&lt;<a href="mailto:s.koschnicke@gfxpro.com" target="_blank">s.koschnicke@gfxpro.com</a>&gt;    wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hello,<br>
<br>
I think your guess wasn&#39;t completely wrong. I tested with Sqlite now, and<br>
with that rails and yesod are equally slow (rails 11.81 secs vs yesod<br>
11.36<br>
secs). But its also interesting that your code change speeds it up.<br>
<br>
(I put the sqlite benchmark at<br>
<a href="https://github.com/SKoschnicke/performance-test/tree/sqlite" target="_blank">https://github.com/SKoschnicke/performance-test/tree/sqlite</a>)<br>
<br>
My first guess was actually that its the marshalling which slows yesod so<br>
much and that rails uses some clever optimizations there, but I haven&#39;t<br>
got<br>
enough insight to validate that.<br>
<br>
Greetings<br>
  Sven<br>
<br>
<br>
<br>
On 03/21/2011 01:49 PM, Michael Snoyman wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Looks like my initial guess was completely wrong: on my system, almost<br>
no time is spent on the database query. Instead, it looks like there&#39;s<br>
some kind of performance issue with Hamlet. For example, changing line<br>
20 of Handler/Quote.hs from &quot;addWidget&quot; to &quot;addHtml&quot; increases<br>
performance dramatically (25 sec to 4.5 sec). I&#39;ll need to spend some<br>
more time to properly diagnose the problem. Again, thanks for bringing<br>
this to my attention.<br>
<br>
Michael<br>
<br>
On Mon, Mar 21, 2011 at 12:40 PM, Michael Snoyman&lt;<a href="mailto:michael@snoyman.com" target="_blank">michael@snoyman.com</a>&gt;<br>
  wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Firstly, thank you for running this benchmark: it&#39;s the only way we<br>
can find out where Yesod needs to be fixed.<br>
<br>
I haven&#39;t had a chance to look into the code properly, but it looks<br>
like this is more a test of the database backend than of the web<br>
framework. I&#39;ll try to get to this myself later, but it would be very<br>
interesting to see the difference in response times between PostgreSQL<br>
and sqlite. Currently, persistent-sqlite binds directly to the sqlite<br>
C API, while persistent-postgresql uses HDBC. It&#39;s entirely possible<br>
that HDBC is adding some overhead.<br>
<br>
One of the items on our wish list[1] is to migrate away from HDBC.<br>
Having hard numbers like you are providing will help us figure out our<br>
priorities a bit better.<br>
<br>
Thanks,<br>
Michael<br>
<br>
[1] <a href="http://wiki.yesodweb.com/Wishlist" target="_blank">http://wiki.yesodweb.com/Wishlist</a><br>
<br>
On Mon, Mar 21, 2011 at 12:10 PM, Sven Koschnicke (GFXpro)<br>
&lt;<a href="mailto:s.koschnicke@gfxpro.com" target="_blank">s.koschnicke@gfxpro.com</a>&gt;      wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hello,<br>
<br>
I&#39;m coming from a Rails background and was very impressed by the<br>
features of<br>
the Yesod Web Framework. Working on an trading app in Rails I wanted<br>
to<br>
port<br>
some features of this app to a Yesod app just to learn the framework<br>
and<br>
because we have some performance issues with Rails.<br>
<br>
The first thing I noticed was that the Yesod app was significantly<br>
slower<br>
than the Rails app at trivial tasks. I am very astonished about that.<br>
I<br>
thought Rails should be slower because of its interpreted nature. I<br>
made<br>
some benchmarking and measured that a simple Rails app is fourteen<br>
times<br>
faster than a Yesod app that did the same thing (loading some records<br>
from<br>
the database and displaying them). Did I made a mistake or is my<br>
understanding, that the compiled app should be faster, just wrong?<br>
<br>
I documented the results on github:<br>
<br>
<a href="https://github.com/SKoschnicke/performance-test" target="_blank">https://github.com/SKoschnicke/performance-test</a><br>
<br>
Greetings<br>
  Sven Koschnicke<br>
<br>
_______________________________________________<br>
web-devel mailing list<br>
<a href="mailto:web-devel@haskell.org" target="_blank">web-devel@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
<br>
</blockquote>
<br>
</blockquote></blockquote>
<br>
<br>
</blockquote></blockquote>
<br>
<br>
</blockquote></blockquote>
<br>
<br>
_______________________________________________<br>
web-devel mailing list<br>
<a href="mailto:web-devel@haskell.org" target="_blank">web-devel@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Knut Olav Bøhmer<br>