Camelia, the Perl 6 bug

IRC log for #mojo, 2011-02-05

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:05 ispy_ joined #mojo
00:08 metaperl joined #mojo
00:16 metaperl1 joined #mojo
00:20 metaperl left #mojo
00:36 marty left #mojo
00:50 kaare left #mojo
01:12 ispy_ left #mojo
01:13 ispy_ joined #mojo
01:17 gshank_ joined #mojo
01:20 ispy_ left #mojo
01:22 gshank left #mojo
01:42 ispy_ joined #mojo
01:53 ispy_ left #mojo
01:54 perlrocks Twitter: "RT @ hokkaidopm pm Hokkaidou great event to welcome teacher's @ yusukebe 2 # 4 / 19 will be held! 2 am in control of AM and PM @ charsbar Mojolicious's hands, make the afternoon http://goo.gl/q5YzW Tech Talk" (ja) --PerlCafe http://twitter.com/PerlCaf​e/status/33704938798325761
02:03 stephen left #mojo
02:06 perlrocks Twitter: "Mojolicious story to go if you do not have clothes to wear I think." (ja) --5_1_5 http://twitter.com/5_1_5/status/33707888388083712
02:12 metaperl1 left #mojo
02:18 metaperl joined #mojo
02:31 ispy_ joined #mojo
02:48 ispy_ left #mojo
02:53 metaperl left #mojo
03:26 metaperl joined #mojo
03:30 metaperl1 joined #mojo
03:32 metaperl left #mojo
03:44 MojoGuest310 joined #mojo
03:44 MojoGuest310 From: http://www.google.com/search?aq=f&sou​rceid=chrome&ie=UTF-8&q=html5+irc (1 hits)
03:45 MojoGuest310 left #mojo
03:46 MojoGuest895 joined #mojo
03:46 MojoGuest895 From: http://www.google.com/search?aq=f&sou​rceid=chrome&ie=UTF-8&q=html5+irc (2 hits)
03:46 MojoGuest895 left #mojo
04:03 tl joined #mojo
04:05 tholen42 left #mojo
04:38 gshank_ is now known as gshank
04:49 jwang joined #mojo
04:55 bellair2 joined #mojo
04:56 bellair2 left #mojo
05:14 MojoGuest357 joined #mojo
05:14 MojoGuest357 From: http://www.networkedblogs.com/33Knp (53 hits)
05:14 MojoGuest357 left #mojo
05:15 MojoGuest100 joined #mojo
05:15 MojoGuest100 From: http://news.ycombinator.com/item?id=1277067 (193 hits)
05:15 MojoGuest100 left #mojo
05:56 perlrocks Twitter: "Mojolicious:: Plugin:: JsonConfig write test passed because there was no attempt to rework necessary functions w github who'd love had been fixed" (ja) --shiba_yu36 http://twitter.com/shiba_yu​36/status/33765812804259840
05:56 ispy_ joined #mojo
06:30 MojoGuest814 left #mojo
07:10 btn joined #mojo
08:17 metaperl joined #mojo
08:23 metaperl1 left #mojo
08:31 metaperl left #mojo
08:31 crab damn.
08:31 crab my csrf protection is so effective that now writing tests for login etc. are all a pain. :-)
08:34 perlrocks Twitter: "Yomojo Mojolicious moji" (ja) --rshhh http://twitter.com/rshhh/status/33805708822585344
08:35 metaperl joined #mojo
09:03 ispy_ left #mojo
09:42 crab now i'll have to redo all my tests. sigh.
10:07 marcus crab: because of your csrf protection?
10:47 rupertthehacker left #mojo
10:58 metaperl left #mojo
11:00 rupertthehacker joined #mojo
11:08 marcus sri: can hypnotoad run psgi apps?
11:08 marcus or only mojo apps?
11:16 * marcus is less than impressed by dancer's tutorial # http://search.cpan.org/~sukria/Dan​cer-1.3002/lib/Dancer/Tutorial.pod
11:19 marcus specially the flash part
11:19 marcus it seems utterly evil
11:20 crab marcus: yeah, all these tests are basically CSRFs :-)
11:22 crab i don't think hypnotoad can run psgi apps
11:31 sri moin
11:32 sri marcus: nope it can't
11:32 marcus sri: ok
11:32 sri you could write a custom mojo app to run psgi scripts i guess
11:36 marcus yay, managed to get the basic dancer tutorial app running
11:36 marcus now to port it to mojo...
11:36 marcus dancer guys are having a hackaton at fosdem this weekend. Kinda jealous =)
11:37 marcus sri: hmm, that might be a worthwhile effort
11:38 marcus but first to finish this little benchmark =)
11:41 fhelmber_ joined #mojo
11:41 crab what are you benchmarking?
11:43 marcus dancer and mojo with a TT template and a simple sql database
11:43 marcus basing it on dancer's tutorial, if I can get it to actually work -.-
11:44 crab what, requests per second?
11:44 marcus yes :p
11:45 marcus not to see which one is slower, but to see if the hypthesis that the template+the database will be the major bottleneck is true
11:45 marcus specially for CGI
11:52 crab good plan.
12:06 GitHub27 joined #mojo
12:06 GitHub27 mojo: master Sebastian Riedel * 05a0923 (2 files in 2 dirs): added a witty comment and improved a guide - http://bit.ly/hNtvYf
12:06 GitHub27 left #mojo
12:19 p1d joined #mojo
12:35 * marcus wonders how to get layouts working with the tt renderer
12:38 * marcus checks to see how dancer is doing tt layouts
12:41 marcus oh. it's doing it as a separate tt render call
12:45 marcus sri: when I add layout to the render call with the TT plugin, it seems to add the layout at the end of the output.
12:46 marcus rather than including the content in it
12:49 marcus hmm, guess I could fake it with render partial and then render the layout..
12:51 stephan48 doesnt you have wrappers in tt?
12:55 marcus you mean the built in ones_
12:56 marcus yes, but that wouldn't be fair in this context :)
12:56 marcus anyways, this worked - http://pastebin.com/qWVJZEgh
12:57 marcus guess tt_renderer needs a fix to support the layout keyword
12:59 marcus seems the renderer implements layouts with extends
12:59 marcus so the TT renderer actually needs to support extends
12:59 sri extends and layout are almost the same
13:00 sri layouts just have a layouts/ prefix ;)
13:00 marcus sri: yeah, I noticed
13:01 marcus sri: any idea why the tt renderer would put the extended template at the bottom?
13:01 * marcus takes a look at it
13:01 sri your module ;p
13:01 marcus ask's module actually
13:01 marcus but seems he has moved on to dancer.
13:01 sri don't think anyone ever cared about the built in layout stuff for tt
13:02 sri the tt renderer prolly just appends the result to $$output or so
13:02 sri instead of overwriting
13:03 sri i guess [% c.content %] or so just works anyway
13:04 marcus [%- WRAPPER 'layouts/layout.html.tt' -%]
13:05 marcus that's from the tt unit test
13:05 marcus that is using the built in tt wrapping functionality tho
13:06 sri well, i just told you the bug
13:06 sri don't think you have to change anything else
13:06 sri helpers should just work
13:07 marcus sri: so the tt renderer should clear $$output before calling process?
13:08 sri ye
13:08 sri or actually overwrite it
13:08 sri not sure if there are side effects to clearing
13:08 marcus $$output = '';
13:09 marcus that works
13:10 ispy_ joined #mojo
13:10 marcus with that one line change, layout=>'main' works as a render argument
13:10 marcus sri++ # Cunning like a fox
13:10 * sri howls
13:11 marcus s it as cunning as a fox what used to be Professor of Cunning at Oxford University but has moved on and is now working for the U.N. at the High Commission of International Cunning Planning?
13:11 sri no wait, that were wolves
13:11 sri what do foxes do?
13:12 crab foxes bark, yelp, wail, purr, etc. very vocal.
13:13 sri guess i need to watch that documentaty again.... "fantastic mr fox" or what it's called
13:13 sri s/t/r/
13:13 * sri barks
13:13 marcus yeah, that's a great documentary
13:14 marcus I was especially surprised about the living conditions of the foxes
13:14 sri fascinating creatures
13:14 crab is it disproportionate to their known sources of income?
13:15 marcus crab: only because they steal.
13:15 marcus Hmm. test failure :|
13:16 sri yay for side effects
13:16 marcus expected 'wrapped', got 'wd'
13:16 marcus interesting
13:17 marcus wow
13:17 marcus get '/with_auto_wrapper' => sub { shift->render(auto_wrapper => layout => 'layout') };
13:17 marcus that seems wrong
13:17 sri it's not
13:17 marcus template is optional?
13:17 sri ye
13:18 sri or is it
13:18 rupertthehacker left #mojo
13:18 * sri scratches head
13:18 sri $c->render('foo/bar', format => 'html');
13:18 sri thats what the pod says
13:19 sri should be fine then
13:20 marcus [%- c.content -%] returns an empty body for some reason.
13:21 marcus it works in my app tho
13:22 perlrocks Twitter: "trying to decide: #mojolicious or #dancer, not easy. At the end: #catalyst wins #perl" --perloop http://twitter.com/perloop​/status/33878042950500352
13:22 p1d left #mojo
13:22 marcus weirdo
13:22 marcus :)
13:27 tholen joined #mojo
13:29 * tempire doesn't understand how anyone could possibly choose catalyst over mojolicious
13:31 su-bzero tempire: Catalyst don't break your application every 2 weeks.
13:31 su-bzero *doesn't
13:31 su-bzero After update.
13:33 marcus it doesn't get any new features either.
13:34 tempire I suppose if a production app didn't have a test suite and continually tried to use a bleeding edge version, that would be a problem.
13:35 tempire any real production app I've been involved with doesn't update their framework lightly, though.
13:35 sri did we have any breakage since 1.0?
13:35 su-bzero tempire: Yes, tests save us. But when you need a bug fix (that something
13:35 su-bzero will work), you need to update.
13:36 su-bzero sri: With ->session and ->sessions
13:36 sri bullshit
13:36 sri thats deprecated
13:36 su-bzero And when action is required.
13:37 sri thats a bug
13:37 sri or rather, was a bug
13:37 su-bzero ;)
13:37 sri it had no documentation or tests
13:38 tempire Why do conferences seem to hide their registration costs?
13:38 sri don't ever use something that's undocumented
13:39 marcus and if you fear breakage, don't use 'experimental' features either.
13:39 sri right
13:39 tempire How can I confidently submit a proposal for oscon if I don't even know how much it's going to cost me?
13:40 marcus tempire: I think speakers get in free
13:40 marcus I could be wrong tho
13:40 tempire I was hoping that's the case, but I can find no confirmation on that.
13:40 GitHub168 joined #mojo
13:40 GitHub168 mojo: master Sebastian Riedel * c088855 (1 files in 1 dirs): changed requirements for a feature - http://bit.ly/gWWfM4
13:40 GitHub168 left #mojo
13:41 tempire Someone with more twitter followers should ask that question.
13:41 * tempire pokes everyone
13:42 sri marcus is the celebrity here
13:42 marcus wow, didn't know I had more followers than you, sri
13:43 sri :,(
13:43 marcus twice as many, in fact ;)
13:43 tempire The life of a super-villain is a lonely one.
13:43 tempire So...here's my issues with submitting a proposal for oscon:
13:44 * sri needs a cup of hot cocoa
13:44 tempire I've never made a presentation before.  I've never been to a conference except for perl oasis, which is uber tiny.  I don't have a lot of experience with other frameworks to make educated comparisons.
13:45 moritz perl conferences are a good place for first talks, very friendly athmosphere
13:46 tempire any oscon veterans here?
13:46 * tempire looks to marcus the celebrity for guidance
13:47 tempire I'm thinking I should go to an oscon first, before giving a talk.
13:48 sri a mojolicious talk there would be nice, but you might be right
13:49 tempire ok, next year then
13:50 marcus 'Someone in the know, please tell @tempiretech if oscon presenters get in for free?'
13:52 tempire Next year, I can talk about mojolicious and how well it works with my riak okm :)
13:53 sri next year sql will be hip again :o
13:53 marcus broken hip
13:54 marcus sri: you would prefer if the tt renderer distribution was Mojolicious-Plugin-TtRenderer right?
13:54 sri or even Mojolicious::Plugin::TemplateRenderer
13:55 tempire That sounds too generic to me.
13:55 marcus plugin 'template_renderer' would look nicer.
13:55 marcus but maybe generic
13:55 marcus the distribution is 'Template' tho
13:56 tempire does it cover tt3 as well as tt2?
13:57 tempire might be a good idea to specify that in the dist name.
13:57 tempire unless it would be an optional parameter
13:57 tempire I've already got a new follower due to marcus' celebritiness.
13:57 * tempire climbs the ladder to fame
13:59 sri http://www.oscon.com/oscon2010 # you're in the twitter feed on the site
14:00 omega tempire: the new follower might have been me :)
14:00 moritz oscon2010 is so last year :-)
14:00 sri oh right
14:01 kaare joined #mojo
14:10 marcus now that I am done shaving the TT yak, I can go back to my port of the dancer tutorial
14:17 rshhh left #mojo
14:19 rshhh joined #mojo
14:37 * omega is shaving builder yaks, and broken test yaks
14:38 marcus omega: as long as you don't shave your luscious beard... :p
14:39 omega I actually trimmed the mustache part of it just now a bit, as it was getting in my food :p
14:39 omega but I'm keeping the rest until after svalbard at least :p
14:39 marcus good idea
14:41 sri real vikings and programmers have beards?
14:42 omega its not THAT long
14:43 marcus I now has working mojolicious implementation of the dancer tutorial app - https://github.com/marcusramberg/bench
14:43 marcus including the broken flash implementation, would be unfair to use mojolicious' real flash
14:44 marcus (Dancer also has working flash support in a plugin, apparently)
14:45 sri your indentation is weird
14:45 marcus I think I reindented it using textmate
14:46 marcus I guess I didn't
14:46 sri use the perltidy luke!
14:46 crab how can i extract (as opposed to test) response text from a Test::Mojo?
14:46 sri $t->tx
14:47 marcus yeah, that's better
14:47 marcus sri: pushed reindentation
14:48 marcus sri: agree it mojo-test.pl loooks like a straight reimplementation of dancr.pl ?
14:48 marcus I guess using the json loader is a bit unfair if testing cgi, guess I should put the config hash in the file.
14:49 sri the broken flash makes my heart bleed
14:49 marcus :D
14:50 marcus they promised to fix their tutorial asap
14:50 crab sri: so after i do a $t->get_ok($whatever)->...; i can look at $t->tx->res and it'll be the get?
14:50 sri yea, loading the json will cost
14:51 crab what is broken about their flash? (i didn't look)
14:51 marcus crab: they store it in a instance variable $flash
14:51 marcus rather than in a cookie or whatever
14:51 marcus it's just the tutorial example tho
14:52 crab so if your next request hits a different process you're out of luck?
14:52 marcus yeah, or if you run in cgi mode, or if another use hits between your requests.
14:52 marcus another user
14:55 sri it's very very wrong
14:56 sri they've not even fixed the route caching pod i pointed at last year
14:56 sri http://search.cpan.org/~sukria/Danc​er-1.3002/lib/Dancer/Route/Cache.pm
14:56 sri "A major drawback is that http://search.cpan.org/~sukri​a/Dancer-1.3002/lib/Dancer.pm has to go over the matching on every request, which (especially on CGI-based applications) can be very time consuming."
14:56 sri yea, an in memory cache will totally help with cgi!
14:57 marcus lol
14:58 marcus anyways, with starman, the dancer app does ~400 requests vs ~350 for mojolicious
14:58 marcus not big enough difference to care
14:58 sri mojo in dev mode?
14:58 marcus on my mbp
15:01 sri you're getting 400 database queries per second? :o
15:01 marcus hmm, actually, the app wasn't rendering at all with starman, because it could not find it's template.
15:01 marcus on mojolicious
15:01 sri latest github?
15:02 sri i'vr fixed some home detection issues with plack recently
15:02 marcus sri: ok, upgrading now
15:02 sri previously you had to set MOJO_HOME
15:02 sri plack makes detection insanely hard
15:03 marcus Sat Feb  5 16:02:53 2011 error MojoX::Renderer::TT:87 [28774]: Template error in "show_entries.html.tt": file error - templates/show_entries.html.tt: No such file or directory
15:03 marcus seems it has troubles with home still, on github master
15:03 sri no idea then
15:03 sri MOJO_HOME required i guess
15:03 marcus yeah
15:04 marcus it works if I set MOJO_HOME
15:04 crab sri: when i do $t->tx->res->dom('input[na​me="__token"]')->each(sub {print Dumper shift}); i can see that i get { tree => [ ... ] } and the first element is my input tag, but what is the right way to access its value?
15:04 sri i bet starman does stuff different than plackup... it's a mess
15:04 marcus sri: Requests per second:    341.94 [#/sec] (mean)
15:04 marcus sri: actually, I am starting starman through plackup
15:04 marcus sri:  MOJO_HOME=/Users/marcus/bench MOJO_MODE=production  plackup -E deployment -s Starman --workers=10 -p 5001 -a mojo-test.pl
15:04 marcus that borks without MOJO_HOME
15:05 * sri shrugs
15:06 marcus sri: app home is detected as '.'
15:06 sri seems right
15:06 marcus yeah, wonder why template toolkit fucks up
15:06 sri maybe starman chdirs?
15:06 marcus looks like it expects home to be an absolute dir
15:07 marcus maybe
15:07 sri well, patches welcome
15:07 purl patches welcome is always true or unless for search.cpan.org or swahili for "Put up or shut up."
15:08 marcus no, it doesn't chdir
15:08 marcus So WEIRD
15:09 sri and it just works with the built in daemon?
15:09 marcus yes
15:09 sri strange
15:10 marcus hmm, actually no
15:10 marcus it did until I upgraded to master
15:11 marcus sri: did you change home from absolute to relative recently?
15:11 sri nope, i improved detection for plackup
15:12 sri seems to be tt then that doesn't like relative paths
15:13 marcus it works again if I downgrade to 1.01
15:13 sri old detection prolly
15:13 marcus No
15:13 sri ?
15:13 marcus Home is '/Users/marcus/bench' in the old one
15:13 marcus and '.' in master
15:13 marcus so it changed from absolute dir to relative
15:13 sri so it is old detection
15:14 sri it's not guaranteed to be either
15:14 marcus I think a lot of stuff would break from that.
15:14 sri why?
15:14 marcus because the TT renderer breaks? :)
15:15 sri well, then it was broken before ;p
15:15 marcus uhm
15:15 marcus my $dir = $app && $app->home->rel_dir('tmp/ctpl');
15:15 sri ?
15:15 marcus will that still work?
15:15 sri of course
15:15 sri just based on .
15:15 sri as in ./tmp/ctpl
15:16 marcus mm
15:16 sri you might have gotten relative paths in other environments too before
15:16 marcus hmm
15:16 marcus I worry about this change.
15:16 marcus I think it will break some people's production environments
15:17 marcus if pwd isn't the current dir for instance
15:17 marcus which will commonly be the case
15:17 sri well, feel free to improve it
15:17 sri path detection is insanely tricky
15:18 marcus I think reverting the change would be an improvement.
15:19 sri umm
15:19 sri it would require MOJO_HOME for everything plack based again
15:23 sri this is not a yes or no question
15:24 marcus 8a7633ccc9e4247f5016854bd11c2ea0f9c657de
15:24 marcus that is the change, right?
15:25 sri yes
15:25 sri could have been a followup too
15:26 sri i think most people even used relative paths with MOJO_HOME
15:27 sri even if we changed those hacks to use Cwd::abs_path, there is still no guarantee
15:29 sri does $FindBin::Bin always contain an absolute path?
15:29 sri that could be another source for relative ones
15:30 ispy_ Hey everyone, anyone using Hypnotoad in production? Just curious...
15:30 sri yes
15:30 ispy_ sri: and your opinion of sucha setup?
15:30 sri i love it
15:31 ispy_ Any way to do virtual hosts>?
15:31 sri nginx reverse proxy
15:31 ispy_ ok...
15:31 ispy_ thanks dude.
15:32 sri i love it mostly because of "git pull origin master; sudo kill -s 'USR2' `cat hypnotoad.pid`"
15:32 sri thats all i need for a zero downtime software upgrade
15:32 ispy_ sri: Yeah, that's one of the reasons I was interested...
15:32 ispy_ sri: Do you feel, given the appropriate hardware, that it could sustain more than 100 concurrent connections?
15:32 sri easily
15:33 ispy_ ok... then I think I may be adjusting my stack a bit...
15:33 marcus I also use it in production
15:33 ispy_ marcus: And you've been pleased?
15:33 marcus sri: less bad than I thought. If you give a absolute path to plackup or the script it works.
15:33 ispy_ Basically, I'm tinkering with alternatives to my LAPP stack +FCGI
15:34 sri guess caller returns an absolute path then
15:34 marcus ispy_: yes, I have been pleased.
15:34 marcus sri: it will probably work in most setups then.
15:34 marcus just need to fix TT
15:34 marcus sri: maybe add abs_path to Mojo::Home?
15:35 sri dunno, tests need to be rewritten then
15:36 sri well, if you can do it properly knock yourself out :)
15:36 sri better and more detection tests sure wouldn't hurt
15:37 sri whats the cost of abs_path btw?
15:38 sri it causes multiple disk lookups right?
15:38 crab so how do i get my input value? ->[0]->attrs->{value}?
15:39 marcus sri: Cwd is a core module, right?
15:39 sri ye
15:41 marcus seems Cwd::abs_path uses various methods depending on the OS
15:43 marcus mm, TT test suite fails miserably on master too
15:44 crab All tests successful.
15:44 crab Files=1, Tests=191,  8 wallclock secs ( 0.22 usr  0.03 sys +  4.88 cusr  0.20 csys =  5.33 CPU)
15:44 purl pass(); ok(1); is(1,1); done_testing();
15:44 crab whee.
15:47 crab mojo's signed cookies actually allow me to do proper login csrf protection too.
15:51 marcus hurgle.
15:51 crab sri: suppose i have a set of paths like /widgets/:widget_id/<bunch of actions>
15:52 crab would it be an appropriate use of a waypoint to call upon an action that sets $c->stash(widget=>Widget->new($id))?
15:52 crab so that any interior actions find that object in their stash already
15:54 crab of course it's natural to use a bridge where i have to veto access, e.g. user does not have access to $widget. but suppose that's not the case here.
16:01 marcus hmm, if I want a custom exception template.
16:02 marcus didn't sri just add something to make that easier?
16:02 marcus exception.$mode.html.ep so so?
16:10 sri yes i did
16:11 marcus heh
16:12 marcus for some reason it is not picking up t/templates/exception.test.html.ep
16:12 sri is the mode test?
16:12 sri most people use testing
16:12 duff left #mojo
16:12 marcus hmm, actually I was setting app->mode('test') in the test
16:12 sri testing is actually our test case
16:13 marcus but if I use MOJO_MODE=test on the command line it works
16:13 crab i actually wrote http://toroid.org/ams/etc/mojo-testing-exceptions about that the other day
16:13 marcus app->mode('test');  <- doing it wrong?
16:13 sri app->mode is usually too late
16:15 sri https://github.com/kraih/mojo/blob/​master/t/mojolicious/testing_app.t
16:15 marcus BEGIN { $ENV{MOJO_MODE}='testing';};  did the trick
16:15 crab sri: waypoint?
16:15 purl it has been said that waypoint is alive here, but I can ping anything. Hints?
16:15 marcus guess I would not need begin
16:16 sri crab: why are you not in the blog aggregators?
16:17 sri crab: can you turn that into a simple question?
16:18 sri you should get onto planet ironman and perlsphere
16:18 crab sri: will you beat me if i use a waypoint to load objects into the stash, or is that what they're for?
16:18 sri don't use waypoints
16:19 sri you would know exatly what they did if you really needed them :)
16:19 sri you just want a bridge again
16:20 sri don't think anyone needed waypoint yet though -.-
16:21 sri marcus: http://www.imdb.com/title/tt1740707/ # wtf?
16:22 marcus sri: it seems pretty good
16:22 marcus been waiting for it for a while
16:22 crab ok, i'll use a bridge. i can always return 0 if the widget id is invalid or whatever.
16:23 sri i thought santa was norways biggets secret
16:25 marcus sri: Finland stole him from us, so now all we have are trolls
16:25 sri those bastards!
16:31 perlrocks Twitter: "[Perl] Mojo:: Client tried to use the http://d.hatena.ne.jp/meme​memomo/20110205/1296923500" (ja) --memememomo http://twitter.com/memememo​mo/status/33925722816913408
16:31 marcus sri: really weird. tt renderer seems to have problems finding inline templates as well on master.
16:31 marcus don't see how that is affected by home
16:32 sri weird
16:38 crab heh, 4 posts every 32 days
16:40 crab i've done eight posts on perl since july 2009.
16:41 sri stop chatting and blog!
16:42 * marcus blogs about the evil overlord of #mojo
16:42 * sri throws fireballs at marcus
16:42 marcus 'beware, or you will fall into his indenture'
16:47 marcus sri: $options->{inline} is suddenly empty in trunk.
16:48 sri that would break countless core tests
17:09 marcus HMM
17:10 marcus I think the test failures are due to the changes in the auto renderer
17:12 marcus no
17:12 marcus I'm just confused I guess
17:14 dhg joined #mojo
17:16 marcus Asking provider for t/templates/t/templates/unicode.html.tt -  at /Users/marcus/Source/mojox-rende​rer-tt/lib/MojoX/Renderer/TT.pm line 159. <- I can see why that would not work...
17:18 marcus ws the old one Asking provider for /Users/marcus/Source/mojox-render​er-tt/t/templates/wrapper.html.tt - [%- WRAPPER 'layouts/layout.html.tt' -%]
17:18 sri hmm
17:19 marcus first one is debug output from master, other one from 1.01
17:19 sri we need a core test i guess
17:20 sri i don't even know where the connection to mojo core is
17:22 sri especially why it does not affect the core renderers
17:23 marcus I think it's still just the tt renderer that does not handle relative paths to templates.
17:24 sri abs_path in the tt renderer?
17:24 marcus yepp
17:24 marcus my $path = abs_path($renderer->template_path($options));
17:24 marcus this fixes the issues
17:25 sri hmm
17:25 sri costly
17:26 marcus mm, I tried doing it by fixing 'INCLUDE_PATH in init.
17:26 marcus but for some reason it seems to prefer rendering full paths.
17:26 marcus which seems a bit crazy
17:26 marcus guess that is why ABSOLUTE =>1 is enabled
17:27 marcus I am thinking it probably shouldn't use template_path at all
17:27 marcus or ABSOLUTE => 1
17:27 marcus it should render paths like 'foo.html.tt' and look them up in INCLUDE_PATH
17:28 sri thats exactly why we have ->template_name()
17:28 marcus yes
17:28 marcus I'll switch to using template_name
17:28 marcus it seems a lot saner
17:29 sri well, most of the design predates all the new helper methods and stuff
17:29 sri (of the tt renderer)
17:30 sri wish i could purge all the old mojo extensions from cpan :S
17:30 sri and start fresh with 1.0
17:39 sri i hate plack
17:39 sri it makes detection so damn hard
17:44 perlrocks Twitter: "Want to take over the AnyEvent::Mojo module? I don't use it anymore, its broken, and I lack the time. Will remove from CPAN soon #perl #mojo" --pedromelo http://twitter.com/pedromel​o/status/33944024263950337
17:46 marcus all tests successful.
17:46 purl pass(); ok(1); is(1,1); done_testing();
17:46 sri \o/
17:47 marcus gonna see if it passes on 1.01 too
17:52 sri i have a core hack that might make the old one work again too
17:52 sri but i'm not sure i should throw more untestable hacks at the problem
18:19 GitHub192 joined #mojo
18:19 GitHub192 mojo: master Sebastian Riedel * 343d0e6 (2 files in 2 dirs): tweaked home detection and added better tests - http://bit.ly/eQO3Xv
18:19 GitHub192 left #mojo
18:19 sri marcus: please test
18:20 sri if it works relative paths should be impossible
18:20 sri but for improvements i'm going to need tests
18:20 marcus ok :)
18:20 marcus I'll test with the CPAN version of TtRenderer
18:21 marcus given that I have fixed it in my trunk
18:22 sri absolute paths are more predictable i guess, and i want people to write me test cases -.-
18:22 marcus yeah, it is more predictable
18:22 sri even more potential for breakage though :S
18:22 marcus and it works fine with cpan version of ttrenderer now
18:22 marcus and with my trunk
18:22 sri \o/
18:23 sri also with plack?
18:23 marcus yepp, also with plack & starman
18:24 sri \o/
18:24 marcus \o/
18:24 marcus sri++
18:24 sri from now on we do not touch that code ever again!
18:24 marcus agree
18:24 marcus put some really nasty quote in there
18:24 sri suggestions?
18:24 purl suggestions are like suits.  Either they're tailored to the problem at hand, or they don't fit well.
18:24 * sri pats purl
18:24 purl don't mess with me
18:25 marcus Lionel Hutz: This is the greatest case of false advertising I’ve seen since I sued the movie “The Never Ending Story.”
18:25 sri :D
18:25 sri we need windows testers though
18:25 marcus and doors
18:26 sri trap doors
18:28 marcus interesting
18:29 sri i don't like it when you say that :S
18:30 marcus with a single processes, dancer does about 170 rps vs 220 for mojo ( on starman)
18:31 sri interesting
18:31 sri thats with template and sql?
18:31 marcus with 10 concurrent, they do 616 vs 500
18:31 marcus yes
18:31 marcus sqlite and tt
18:31 sri ah ok, no network connection
18:31 marcus mm
18:31 sri latency is a bitch
18:32 marcus which is why I always run my database on localhost
18:32 marcus :)
18:32 sri unrealistic!
18:32 purl somebody said unrealistic was giving it a huge compliment.  I was thinking closer to "how stupid does this guy think the public actually is, because right now, he's offensive beyond words."
18:33 marcus not really, if you can run a cluster and a db node on each web node
18:33 marcus but maybe not so smart
18:34 sri what slows down mojo?
18:34 marcus I have no idea. I could run it through nytprof
18:34 sri maybe logging?
18:34 marcus to see where it spends it's time
18:34 sri we flock
18:35 marcus it's not logging much in production mode tho
18:35 sri yea, hmm
18:35 marcus and actually my test app doesn't have a log dir
18:35 sri how many cpus?
18:36 sri or cores
18:36 sri 10 processes seems a bit much for a small machine
18:37 sri 2-4 workers per core has been ideal in my tests
18:37 sri also how much better does hypnotoad perform?
18:37 marcus hypnotoad does 530 rps
18:38 marcus only with default number of workers tho
18:38 sri ok
18:39 marcus (testing on my 2 core 2.66ghz i7
18:39 marcus ~ 570 with 10 children
18:40 sri oh right, blocking dbi calls...
18:40 marcus mm
18:40 sri of course you benefit from more workers
18:40 marcus it's the same for dancer on starman tho
18:41 sri good results, but might be interesting to get to know the reason for the slowdown
18:44 marcus yeah, I think we can conclude that mojo would be noticably slower in a real world cgi app based on these numbers tho.
18:45 sri how so?
18:45 marcus seeing as dbi+rendering isn't the bottleneck in a 9 rps vs 35 rps (for web-simple) setting
18:46 marcus or 9 vs 15 for mojo/dancer as mateu was getting yesterday
18:46 sri not sure sqlite counts
18:47 sri it might even have cached stuff in memory
18:47 sri have you done startup benchmarks with sqlite?
18:48 sri that would really show it
18:49 marcus I will try in a bit
18:49 marcus according to NYTProf  IO::Poll::_poll is the place mojo spend most of it's time
18:49 sri but overall i'd say "good enough" for an entirely unoptimized framework
18:50 marcus yeah, I agree
18:50 sri what environment?
18:50 purl i heard environment was found in %ENV - see perlvar
18:50 marcus built in daemon
18:50 purl built in daemon is single threaded, if app blocks it will feel chunky
18:50 sri ok, thats expected
18:51 marcus Mojo::Asset::File::BEGIN@9 is in 3. place
18:51 marcus with 414ms exclusive time
18:51 sri ioloop is 100% not the bottleneck, see microhttpd ;p
18:51 sri did you serve static files?
18:52 marcus I thought not, only tested this with ab
18:52 marcus I don't think it hits any of the static assets
18:52 sri favicon?
18:52 purl it has been said that favicon is http://www.stars.com/Author​ing/Design/Images/Favicon/ or http://www.chami.com/html-kit/services/favicon/
18:52 sri no wait, ab
18:52 sri thats unexpected then
18:54 sri unneccessary disk io would be huge
18:57 marcus hmm, it's just use File::Copy ();
18:57 marcus called once, taking 199ms
18:57 sri Oo
18:59 marcus Mojo::Base::new is using 72ms for 1000 requests
18:59 marcus for 30082 objects created
18:59 marcus :)
18:59 sri :D
19:00 marcus 6000 Mojo::Path objects
19:00 marcus 4000 Mojo::Parameters objects
19:00 marcus I'll just upload the report so you can peek for yourself
19:00 sri lots of opportunities for optimization
19:01 marcus yea
19:01 sri we might clone a few objects unneccessarily
19:02 marcus no point in micro-optimizing, but it might be worth to fix some waste
19:02 marcus sri: http://nordaaker.com/docs/nytprof/
19:02 sri tt is not a bottleneck? :)
19:02 sri place 4!
19:03 sri it friggin beat the database!
19:03 marcus :)
19:03 sri asset file looks very wrong there -.-
19:03 marcus it's a bottleneck for a persisent env
19:03 marcus but I think the picture would be very different for a cgi setting
19:03 marcus persistent even
19:04 * sri is confused
19:04 marcus this is 1000 requests on mojo::server::Daemon
19:04 marcus and you can see there's 2000 render calls, since I'm using your layouts
19:04 sri well, make the startup test :)
19:05 marcus sure. I'll just profile the mojo cgi
19:05 sri with the exception of Mojo::Path i think it proves that template and db are the bottleneck
19:05 sri io as number one is expected
19:07 sri headers were also expected, and are prolly the biggest opportunity for us to improve something
19:07 marcus http://nordaaker.com/docs/nytprofcgi/ single request
19:07 sri routes also have lots of potential
19:08 marcus tt is up to #3 now :)
19:08 marcus wonder how Mojo::Template would do
19:08 sri yea, tt is crazy
19:08 marcus of course, tt is set up to cache the template to file
19:08 sri MT is really good at startup
19:08 sri beats xslate
19:09 marcus nice
19:09 sri later on it is most likely the fastest pure perl engine
19:09 sri no big surprises really
19:10 marcus I guess the high num on attr is due to client being created?
19:10 marcus and stuff like that
19:10 sri routes, paths and headers need profiling
19:10 sri yea
19:10 marcus I like nytprof
19:10 sri we preload everything
19:11 sri i think yko has proven once that we can get many times better startup costs by lazy loading
19:11 sri but it costs maintainability
19:11 marcus yeah, there was this list post about lazy loading client as well.
19:12 sri as soon as i challenge people to write tests for all the new special cases it gets silent -.-
19:13 sri sqlite is better than i expected, but i suspect caching
19:13 sri it is too smart for benchmarks ;p
19:14 marcus :D
19:14 marcus sneaky sqlite
19:14 marcus also, very small database
19:14 sri get mongodb!
19:14 marcus I have mongodb.
19:14 sri i want to see moose startup times!!!
19:14 marcus oh noes
19:15 marcus ok. I'll redo it in mongodb for your amusement.
19:15 sri lol
19:28 perlrocks Twitter: "Sent an email to perl.org to add #mojolicious to their top list of perl frameworks.  Immediate response was YES! #perl" --insurgentsoft http://twitter.com/insurgents​oft/status/33970212499886080
19:28 sri :)
19:28 marcus don't mess with the insurgents
19:30 marcus http://nordaaker.no/docs/nytprofmongocgi/ mongo wins!
19:30 marcus hmm, looks like it is using mouse rather than moose tho
19:30 sri holy datetime
19:30 sri anymoose i guess
19:30 marcus mhm
19:31 marcus but I have moose installed
19:31 sri mouse is cheating...
19:33 marcus I think the obvious solution is optimizing for ab
19:34 marcus just look for it's user agent
19:34 marcus and return early.
19:34 sri lol
19:34 sri that would be kinda epic
19:35 sri why does mongodb open two temp files?
20:00 marcus it's actually TT, not mongodb
20:00 marcus Template::Document
20:01 sri hmm
20:06 tholen left #mojo
20:06 marcus sub splat     { @{Dancer::SharedData->request->params->{splat}} }
20:08 stephan48 that looks evil
20:09 marcus wow, dancer sloccount is already up to 5,556
20:09 sri i don't think dissecting dancer will be a very enjoyable experience
20:10 sri kinda strange nobody has ported sinatra for real yet
20:14 marcus mm
20:48 dhg left #mojo
22:36 pid joined #mojo
23:01 MojoGuest935 joined #mojo
23:01 MojoGuest935 From: http://news.ycombinator.com/item?id=1277067 (194 hits)
23:01 MojoGuest935 left #mojo
23:05 sri routes caching could be quite interesting
23:05 sri as long as no conditions are involved we can cache based on method and path
23:07 sri $cache->{"GET/foo/bar"} = {captures => {}, stack => [], $endpoint}; or so
23:08 kaare left #mojo
23:55 crab hi.
23:55 crab right now, the mojo app i'm doing is all-https. the front-end apache just redirects everything non-https to https://site and mojo doesn't have anything to do about it.
23:57 crab but i'm going to be doing another where there will be a significant number of public non-https pages. what are the best practices in mojo to redirect-to-https when someone's going to login to, say, edit something?

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary