The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2014-08-16

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

All times shown according to UTC.

Time Nick Message
00:01 disputin joined #mojo
00:02 woz joined #mojo
00:35 preaction joined #mojo
00:38 disputin1 joined #mojo
00:49 good_news_everyon joined #mojo
00:49 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/i_3M2g
00:49 good_news_everyon mojo/master e4045b1 Sebastian Riedel: simplify renderers a bit
00:49 good_news_everyon left #mojo
00:54 good_news_everyon joined #mojo
00:54 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/IatMbQ
00:54 good_news_everyon mojo/master 6660254 Sebastian Riedel: better plugin descriptions
00:54 good_news_everyon left #mojo
01:03 woz joined #mojo
01:23 sh4 joined #mojo
01:43 sri at some point we might want to get rid of epl, since helpers in ep are free now, it doesn't make much sense to keep it
01:45 klapperl joined #mojo
01:45 sri i wonder if we could remove it without deprecating, considering it's practically undocumented and only serves for testing these day :)
01:47 jberger it does serve to show the difference between the renderer and applying the helpers/stash values to it, but I'm not sure that's enough reason on its own
01:47 jberger also they might be free, but perhaps (to someone) they are unwanted?
01:47 sri why would you want to show that?
01:48 jberger as an example for how to implement another
01:48 jberger (a weak argument to be sure)
01:48 sri keeping it as an example seems like the most sensible reason
01:49 sri but the relationship between epl and ep makes that a little weird
01:49 jberger you think so?
01:49 sri having only ep implement everything from top to bottom might actually be better
01:49 sri as an example
01:49 jberger I could believe that
01:50 sri well, my last two commits cleaned up a lot... but the relationship is still a bit odd
01:50 jberger sri: do you think 'carton exec' has any runtime penalty?
01:50 sri i've removed caching from epl and made it a pure ep feature, got a bit of performance out of it and cleaner code
01:51 sri no idea about carton exec
01:51 jberger might be a reason to break out n
01:52 jberger or really, probably best to use wrk
01:52 * jberger always has to reread how to do that well
01:58 neilhwatson /exit
02:01 jberger sri: no real performance hit
02:01 jberger from a quick couple tests
02:04 woz joined #mojo
02:05 sri yay for benchmarking
02:07 jberger I'm benchmarking for benchmarking
02:07 jberger I kinda want to use Carton for the TE benchmark
02:08 sri then do it
02:08 purl then do it is a fish.
02:09 jberger I didn't want to kill the performance, it is a benchmark after all
02:11 jberger "then do it is a fish"?
02:11 jberger purl are you on something?
02:11 purl i don't know, jberger
02:12 jberger I think purl is smo ... ALL GLORY TO THE HYPNOTOAD!!!
02:29 jberger sri: https://travis-ci.org/kraih/mojo/builds/32688099
02:29 jberger :o
02:39 D4RK-PH0ENiX joined #mojo
02:50 noganex_ joined #mojo
02:54 KCL_ joined #mojo
03:05 woz joined #mojo
03:06 D4RK-PH0ENiX joined #mojo
03:16 basic6_ joined #mojo
03:20 preaction joined #mojo
04:06 woz joined #mojo
04:41 davido_ joined #mojo
04:43 jberger https://twitter.com/joelaberger/status/500501594920611842
05:07 woz joined #mojo
05:53 hesco joined #mojo
06:01 woz joined #mojo
06:21 marty joined #mojo
06:38 Vandal joined #mojo
06:41 KCL joined #mojo
06:41 mr-foobar joined #mojo
07:02 woz joined #mojo
07:18 irq joined #mojo
07:25 bowtie joined #mojo
07:34 denis_boyun joined #mojo
08:04 woz joined #mojo
08:07 GabrielV_ joined #mojo
08:12 sujithm joined #mojo
08:29 basiliscos joined #mojo
08:57 mattastrophe joined #mojo
08:59 fitnerd joined #mojo
09:08 woz joined #mojo
09:29 romel hi everyone
09:29 purl Howdy, romel, you fantastic person you.
09:32 romel http://pastebay.com/1483783 - i am getting 'Nothing has been rendered, expecting delayed response' when accessing http://127.0.0.1:300/categories/add
09:32 romel do i need to call $c->render explicitly ?
09:32 romel i thought it should be rendered automatically
09:34 romel i want to move form initialization and processing into separate 'form' method to use it for both 'add' and 'edit' methods
10:03 denis_boyun joined #mojo
10:06 moritz yes, you need to render explicitly
10:07 romel i noticed that calling just $c->render doesn't work so i have to pass controller/action there, right?
10:09 denis_boyun joined #mojo
10:09 woz joined #mojo
10:10 romel if so, i think it breaks my initial idea
10:10 romel or i probably should extract controller/action from $c->req->url ?
10:12 romel $c->render without arguments returns 404 :(
10:12 romel sorry for spamming
10:12 denis_boyun joined #mojo
10:15 denis_boyun joined #mojo
10:46 irq joined #mojo
10:50 sri jberger: how odd
10:50 mr-foobar joined #mojo
10:50 good_news_everyon joined #mojo
10:50 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/E1QNhA
10:50 good_news_everyon mojo/master 79ad961 Sebastian Riedel: fixed compatibility with older versions of Perl
10:50 good_news_everyon left #mojo
10:51 sri i don't see the difference :o
10:52 sri has to be some sort of perl bug
10:53 romel sri: hello, could you please take a look at my question if you have time?
10:56 D4RK-PH0ENiX joined #mojo
11:10 woz joined #mojo
11:10 D4RK-PH0ENiX joined #mojo
11:35 lb calling just $c->render works just fine, if the template is named the same as the controller/action
11:36 lb $c->render() in MyApp::Controller::Foo::bar looks for template (e.g) templates/foo/bar.html.ep
11:57 * sri wonders what's the cheapest way to call a specific function from an arbitrary class
11:57 sri *{"${class}::foo"}->() is not cheap at all
11:58 Eke- joined #mojo
11:59 sri calling it as a method ($class->foo) is quite a bit cheaper actually
12:00 sri $class->can('foo')->() is the slowest yet
12:08 neilhwatson joined #mojo
12:11 woz joined #mojo
12:35 good_news_everyon joined #mojo
12:35 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/_IiivA
12:35 good_news_everyon mojo/master 9193c9e Sebastian Riedel: arguments are required
12:35 good_news_everyon left #mojo
12:37 sri oh, it's cpan day
12:38 good_news_everyon joined #mojo
12:38 good_news_everyon [mojo] kraih tagged v5.29 at 9a79c1b: http://git.io/fm4sRA
12:38 good_news_everyon left #mojo
12:39 good_news_everyon joined #mojo
12:39 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/qalXJg
12:39 good_news_everyon mojo/master 94d484c Sebastian Riedel: bump version
12:39 good_news_everyon left #mojo
12:40 sri got no other choice than to upload a release then ;p
13:04 hesco joined #mojo
13:06 jberger Happy cpan day!
13:12 woz joined #mojo
13:18 dparry joined #mojo
13:20 dparry good afternoon, just trying to get my head round Mango and wondered if anyone here can help. I have the following construct: http://pastebin.com/B9gWgJ6U but when I try to call methods on that the $self->{'MangoInstance'} seems to always be undefined... what am I doing wrong?
13:22 dparry I suspect it has something to do with the "mango" in Mango::Database being weakened but it has me puzzled...
13:28 sri yes, it's because the mango attribute is weakened
13:29 sri umm no wait
13:29 sri lol
13:29 sri you're assigning a list to a scalar
13:31 jberger Ding ding ding
13:32 dparry oh
13:33 * sri is so used to problems being hard that he tends to overlook the simple mistakes :S
13:35 Eke- joined #mojo
13:37 d4rkie joined #mojo
13:40 dparry so, what exactly is returning a list here...?
13:43 lb my $collections = (
13:44 dparry thank you
13:45 dparry wow that is several hours of my life I won't be getting back :)
13:46 neilhwatson It's those long mistakes you never forget.
14:05 dparry thanks for your help guys, have a great weekend
14:05 dparry left #mojo
14:13 woz joined #mojo
14:57 argh joined #mojo
14:58 sh4 joined #mojo
15:04 argh joined #mojo
15:14 woz joined #mojo
15:15 bodgix joined #mojo
15:17 cpan_mojo joined #mojo
15:24 davido_ joined #mojo
16:07 Eke- joined #mojo
16:15 woz joined #mojo
16:29 argh joined #mojo
16:32 jberger I can't remember who my forkcall user are anymore :(
16:33 jberger for cpan day I want to release my error_event branch
16:33 jberger does anyone have any comment?
16:33 jberger https://github.com/jberger/Mojo-IOLoop-ForkCall/compare/error_event
16:38 neilhwatson joined #mojo
16:55 good_news_everyon joined #mojo
16:55 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/d4qLpQ
16:55 good_news_everyon mojo/master 63ed603 Sebastian Riedel: improved Mojo::IOLoop::Client to use a timeout for every connection
16:55 good_news_everyon left #mojo
16:56 jberger this was my 1000th tweet!
16:56 jberger https://twitter.com/PerlTricks/status/500658577695309824
17:00 sri \o/
17:01 sri the ssl thread on the list is kinda funny
17:01 * jberger looks
17:01 sri him: i have a problem, me: give me a test, him: this is what i see, me: give me a test, him: more stuff i see, me: give me a test, him: even more stuff i see, me: give me a test, him: here's a test, me: fixed!
17:02 sri commit above is the solution, timeout was set in the wrong scope... ooops
17:03 sri moral of the story: GIVE ME A TEST!
17:04 jberger yeah, I knew what your comment would be by the time I looked back here again :-)
17:06 jberger sri: any comment on my forkcall patch?
17:06 Eke|| joined #mojo
17:08 sri jberger: don't think i'm qualified to comment
17:09 sri all i can say is "it doesn't look wrong" after skimming through it
17:13 jberger I think its ok too
17:13 jberger I just like having another pair of eyes on things
17:14 jberger the problem is that if the delay doesn't catch the error, it come out of Mojo::IOLoop::Stream as an emit_safe
17:14 jberger which isn't what people would expect
17:15 jberger so its a little extra rigmarole but I think its more user friendly for error handling
17:15 jberger ok, to cpan it goes
17:15 jberger I need to get in on the stats!
17:17 woz joined #mojo
17:18 sri haha, neilb has censored the history of maypole/catalyst/mojo i gave him :)
17:19 jberger I wouldn't mind seeing the original
17:19 jberger email it to me?
17:19 sri already thrown away
17:20 jberger ok m
17:20 jberger nm
17:23 cpan_mojo Mojo-IOLoop-ForkCall 0.13 by Joel Berger - http://metacpan.org/release/JBERGER/Mojo-IOLoop-ForkCall-0.13
17:25 jberger btw I think I have cpan_mojo figured out
17:25 jberger cpan_mojo *problems* figured out
17:25 sri my version was more focused on the communities around the projects, but i guess that doesn't fit into the format
17:27 * sri pats cpan_mojo
17:33 sri jberger: btw. i see you've spent quite some time with the framework benchmarks, what are our bottlenecks?
17:35 jberger you know what's funny, for all the time I have spent on it, I haven't actually profiled the app!
17:36 jberger It's been more about the toolchain
17:36 sri OMG
17:36 jberger I probably should do that!
17:36 sri :o
17:36 * jberger hides
17:36 sri lol
17:36 jberger actually, by simplifying the toolchain so much, its rather easy to deploy locally
17:38 jberger for us, the only other thing that is needed is 'mongo < config/create.js'
17:39 jberger which loads the data into mongodb
17:40 sri would be nice if we actually got an optimization or two out of it *hint hint*
17:40 sri *nudge nudge*
17:42 jberger well, I mean, I did completely rewrite the app from scratch, so its eons better than the old one
17:43 jberger https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Perl/mojolicious/app.pl
17:43 jberger would be cool to use the delay helper
17:43 jberger and I should use $c->helper->delay for performance reasons right?
17:44 jberger I haven't gotten to tinker much with that yet
17:44 sri i wonder if stuff like shift->helpers->render_json() would make a difference ;p
17:45 sri it might not make a difference at all really
17:46 sri depends on how fast/slow the rest of your code is
17:46 cooper joined #mojo
17:46 sri single helper call means it should be too significant though
17:46 sri maybe for the json hello world case
17:47 batman i wonder if AssetPack should have an object for each thing it can process.
17:47 batman like $assetpack->processor->{sass} = Mojolicious::Plugin::AssetPack::Processor::Sass->new
17:47 sri anyway... START PROFILING!
17:47 jberger AAAAAAAAAA
17:47 sri it's so ridiculously simple
17:48 * jberger runs around aimlessly
17:48 jberger nytprof to start?
17:48 sri perl -d:NYTProf myapp.pl daemon -l http://*:8080 -m production; wrk -c 100 -d 10s http://127.0.0.1:8080; nytprofhtml
17:49 sri ; open nytprof/index.html
17:49 sri switch out wrk for whatever test tool you need
17:50 jberger wrk works for me
17:50 sri just stop the daemon whenever you are ready and nytprof writes it's stats
17:51 sri if you're not using nytprof yet... GET STARTED NOW!!!1... it's life changing
17:51 jberger I have used it, but I don't use it very often
17:52 jberger install of nytprof failed!
17:52 sri once you get the hang of inclusive/exclusive times, number of calls and so on, it's really easy to follow the flow and interpret the data
17:53 sri benchmarks are always get requests :S
17:54 sri i have ideas for optimizing methods other than GET/HEAD... but nobody ever tests those :o
17:54 marcus lol
17:54 marcus sri: So we're working to please the benchmarking crowd now?
17:55 sri marcus: i'm ok with good benchmarks
17:55 * sri just hates bad benchmarks that have no relation to the real world
17:56 marcus http://mark.stosberg.com/blog/2008/11/startup-benchmarks-for-mojo-catalyst-titanium-httpengine-and-cgiapplication.html =]
17:56 sri i remember when mark wanted to make us require every module on demand to improve CGI performance ;p
17:57 sri for a time we actually gave in and required Mojo::UserAgent only on demand
17:58 sri don't think anyone actually noticed when i changed that again a few months later :D
17:59 davido_ I guess we can forgive that article for being Nov 2008, marcus.
17:59 sri oh, i've got to bookmark this talk! https://www.youtube.com/watch?v=-F-3E8pyjFo
17:59 davido_ or was it? That doesn't seem quite right.
17:59 sri it was
17:59 marcus davido_: yeah, we're using 3 times the memory now =]
18:00 sri and that's not even counting the leaks!
18:00 davido_ :)
18:00 davido_ I like the bumper sticker on that laptop: My other computer is a data center.
18:01 marcus 27604 marcus    20   0  109480  32744   3728 S   0,3  0,4   0:00.28 perl ./myapp.pl daemon
18:06 sri but seriously, everyone should nytprof more
18:07 davido_ NYTProf::More ;)
18:10 Mikey sri: this commit, in Mango.pm broke my prefork worker.. specifically the switch from the _await until to the do {} while.. because the do {} while always awaits first, so if i ever had more jobs queue up than notifications, it'd burn through the first 8 and then always listen for more notifications before getting a job from the jobs collection
18:10 Mikey https://github.com/kraih/minion/commit/413791527a53f6d080243ec8087985fc4ac951b5
18:11 sri hmm, that talk makes me wonder if we should have an official patch manager
18:12 Mikey i have all my patches pretty much managed and i pay lots of attention to your github repo, obviously that responsibility comes with my behavior haha
18:12 Mikey and i'm using Mojo::Util::monkey_patch!  (which is awesome, thanks)
18:13 sri Mikey: that commit was over a month ago, there is pretty much no chance i can get in the right mindset to discuss it now
18:13 Mikey understood.
18:14 marcus sri: What is wrk?
18:14 purl wrk is probably what I used above and is just good at saturating things
18:14 sri dude
18:14 sri https://github.com/wg/wrk
18:14 marcus japp, I googled :)
18:14 jberger purl: wrk is at https://github.com/wg/wrk
18:14 purl ...but wrk is what I used above and is just good at saturating things...
18:15 jberger purl: wrk is also at https://github.com/wg/wrk
18:15 purl okay, jberger.
18:15 * sri confiscates marcus's hipster license
18:15 * marcus cries in a corner
18:15 marcus I remember when ab was good enough for everbody </oldster>
18:15 sri ab was always terrible ;p
18:16 sri wrk actually provides reliable concurrency and can produce enough load to overwhelm web servers
18:16 marcus it's true :)
18:18 woz joined #mojo
18:18 sri just brew install wrk
18:19 marcus sri: I had to install from src actually, it wasn't in apt
18:19 marcus :p
18:20 sri oh right
18:20 sri you went full penguin
18:20 marcus flamegraphs so sexy. Burn this project down!
18:20 marcus sri: I'm still flipp-flopping in between
18:21 marcus annoying as hell that chrome in linux doesn't support retina
18:21 * sri is ashamed to admit he still can't read the flamegraphs
18:21 batman idea: should we make a ppa for mojo?
18:21 marcus batman: I like that idea
18:21 batman marcus: https://github.com/jhthorsen/mojo-irc/pull/10/files <-- do you like this PR as well? :)
18:22 marcus batman: if it works properly, I love it.
18:22 * sri googles ppa and finds philadelphia parking authority Oo
18:22 batman marcus: hehe. you are assigned. please merge :)
18:22 * batman has been thingking about the ppa idea...
18:22 batman sri: ppa.launchpad.net
18:23 batman sri: up-to-date mojo .deb packages
18:23 sri ah
18:23 marcus batman: Maybe we should setup testing for mojo-irc too?
18:23 batman marcus: sure. go crazy :)
18:23 marcus it's nice to see that tests pass when you accept pull requests.
18:23 batman i have no idea what it actually means, but i think it could be an idea (ppa)
18:23 batman marcus: they pass locally at least :D
18:24 batman PAUSE add message sent ok [200]
18:25 batman Mojo::IRC 0.10 soon available for you to test marcus :)
18:26 thowe joined #mojo
18:26 thowe Hello
18:26 purl hey, thowe.
18:26 batman sri: what do you think about making a ppa for mojo? is it a bad idea or you don't care as long as you don't have to maintain it? ;)
18:26 cpan_mojo Mojo-IRC 0.10 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojo-IRC-0.10
18:26 marcus batman: Seems I can't setup testing for mojo-irc, I'm not admin.
18:26 batman what??!
18:26 * batman fix
18:27 batman how do i make you an admin?
18:27 batman can there only be one admin?
18:27 batman what do i need to do?
18:28 batman "There are only two Sith, one master and one apprentice"
18:28 marcus http://docs.travis-ci.com/user/getting-started/
18:29 jberger sri: so it seems that all the time is in the mojo stack
18:29 marcus I'm not sure if you can give me admin privs or not. If you can it's under admin
18:29 jberger and EV::run of course
18:29 * batman is on it
18:29 jberger what should I be looking at?
18:30 sri batman: don't care as long as i don't have to maintain it :D
18:30 batman sri: that's cool :)
18:30 marcus url_for seems to be the most expensive thing? :)
18:30 batman i will look into it to see if it's awful or not :)
18:30 marcus maybe we could memoize it in a running app?
18:30 marcus it shouldn't change, right?
18:31 sri jberger: i'd start in the top 15 list
18:32 sri Mojo::Headers being way up there is expected, also Mojolicious::dispatch with all the session/static/routes stuff...
18:33 sri look through the functions it's linking to, and hunt for lines that look suspicious
18:34 jberger ha! got one!
18:34 sri functions that get called way too much for the number of requests are an easy target
18:35 jberger https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Perl/mojolicious/app.pl#L26-L27
18:35 jberger can both be state cached
18:35 sri indeed they can!
18:35 batman marcus: https://travis-ci.org/jhthorsen/mojo-irc :)
18:35 marcus yeah, that seems expensive.
18:36 marcus batman: sweet baby beans!
18:36 * batman sets up travis all around
18:36 sri don't shy away from looking into mojo btw. lots of stuff to optimize there too!
18:36 batman which versions should i test? i was thinking 5.10 5.16 and 5.20
18:36 marcus batman: Seems good
18:36 marcus <3 Travis
18:36 sri i'm suspicious of Mojo::Path atm., it's a bit too high in my benchmarks all the time
18:37 sri TEST ALL THE VERSIONS
18:37 batman marcus: indeed. didn't know it was this easy to set up :)
18:37 sri is 5.20 on travis now?
18:38 batman sri: looks like it http://docs.travis-ci.com/user/languages/perl/
18:38 * jberger considers caching my Mojo::IOLoop->delay object
18:38 sri \o/
18:38 sri that's new then
18:39 good_news_everyon joined #mojo
18:39 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/FJqB6w
18:39 good_news_everyon mojo/master 7a1ce18 Sebastian Riedel: test with Perl 5.20
18:39 good_news_everyon left #mojo
18:40 batman :)
18:40 sri yea, works
18:41 KCL_ joined #mojo
18:43 marcus hrm, I guess base can change per request, which would be a blocker for memoizing url_for
18:45 sri url_for is a definitive candidate for optimization
18:45 sri lots of layers to optimize too
18:46 sri the whole path rebuilding stuff is crazy expensive
18:46 sri base changes are not so bad though
18:47 sri they are applied on the highest layer
18:49 marcus sri: I bet it's a good real world candidate too, more complex app has tons of templates with url_for calls
18:50 sri absolutely
18:50 purl Oh my, yes.
18:50 sri we already have a lookup cache for route names there
18:50 sri it's very basic but made a huge difference
18:51 sri https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Routes.pm#L63
18:52 sri i wonder if a higher level cache for the actual path_for result could make it obsolete
18:52 sri the expensive part https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Controller.pm#L345
18:52 sri base application happens below that
18:53 sri the match object does have some context data though, so you can't just straight memoize path_for ;p
18:55 sri this should be a crazy hot spot https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Routes/Match.pm#L34
18:57 batman https://atom.io/packages/ask-stack :)
18:58 sri now that's what i call an ide! ;p
18:59 sri COPYPASTA ALL THE THINGS
19:01 batman :D
19:08 marcus hmm, atom seems to be progressing really quickly
19:09 batman i don't get this: http://www.effectiveperlprogramming.com/2014/08/perl-v5-20-combines-multiple-my-statements
19:10 batman what's different..?
19:14 sri my $foo; my $bar; were two ops
19:14 sri they now get optimized into one op, so it's faster
19:14 batman oh. so it automatically combines them?
19:14 batman right
19:14 jberger sri: refactoring to use steps is noticeably slower than using a bare delay with a finish handler
19:14 batman crazy :)
19:15 jberger 155 rps to 100
19:19 woz joined #mojo
19:28 mattastrophe joined #mojo
19:30 good_news_everyon joined #mojo
19:30 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/njKDhA
19:30 good_news_everyon mojo/master 4eadb95 Sebastian Riedel: more proxy tests
19:30 good_news_everyon left #mojo
19:36 good_news_everyon joined #mojo
19:36 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/pFx4EQ
19:36 good_news_everyon mojo/master b853d16 Sebastian Riedel: fail a little faster
19:36 good_news_everyon left #mojo
19:40 marcus hmm, vimrc is neat.
19:40 marcus vimr even
19:41 good_news_everyon joined #mojo
19:41 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/iosPPQ
19:41 good_news_everyon mojo/master 2c9ff71 Sebastian Riedel: make sure timeout only applies for TLS upgrade
19:41 good_news_everyon left #mojo
19:51 sri oh, vimr does look cool
19:58 sri i'm happy with atom though
20:03 marcus sri: it's actually quite tempting to switch to atom.
20:04 marcus their vim mode seems quite good too.
20:04 marcus sri: Do you have any autocomplete in atom?
20:05 sri you want https://atom.io/packages/autocomplete-plus
20:06 sri it's funny stuff like this can just be packages https://atom.io/packages/file-icons
20:07 sri the perl icon is a very ugly pink by default though :c
20:20 woz joined #mojo
20:25 marcus sri: And what UI theme do you use?
20:29 sri Atom Dark
20:29 sri marcus: so, you've given up already on making url_for faster? :O
20:30 marcus sri: I'm drinking daiquiris and watching the knicks.
20:31 marcus the knick even
20:33 marcus sri: I'm going to give it a shot tho.
20:34 thowe so what's the best way to set Galileo (or things like it) into production mode?  Can it be done in a config file using the config plugin?
20:36 jberger thowe: it just uses Mojolicious's mode handling
20:37 thowe Okay...  so can mode be set on startup or something?  I don't see a way to set mode when launching the app...  WHat's the secret?
20:37 jberger its just any other mojolicious app
20:37 sri what about this is unclear? http://mojolicio.us/perldoc/Mojolicious/Lite#Mode
20:38 jberger thowe: or try `galileo help daemon`
20:38 thowe Ah, there it is.  Thanks.
20:38 jberger I actually usually deploy with hypnotoad, which defaults to production mode
20:39 jberger hypnotoad `which galileo`
20:39 thowe Yeah, that's how I got by that when playing before too.  I plan to have nginx in front of hypnotoad
20:40 thowe First I wanted to see if I could get the login block off of every page and just have a login page of some kind.
20:43 jberger I have wanted to allow easy addition of templates, but I can't remember if I ever got there
20:45 thowe I was just thinking that if you go to /admin you get a login form or you get directed to /admin/pages if you are logged in...
20:46 jberger galileo does have two levels of rights, author and admin
20:46 jberger so you should think about that
20:47 thowe oh...  I see.  Perhaps redirecting to the page you came from then.
21:10 cpan_mojo joined #mojo
21:11 jberger ok, latest cpan_mojo should have reconnecting on stream errors working
21:12 jberger well, hmmm
21:12 jberger maybe a retry timer
21:18 marcus sri: seems url clone is the most expensive thing in a trivial url for
21:18 marcus # spent   661ms making 2841 calls to Mojo::URL::clone, avg 233µs/call
21:20 cpan_mojo joined #mojo
21:21 woz joined #mojo
21:24 marcus sri: A full url clone for getting the request base seems excessive. it includes stuff like cloning the request params.
21:25 sri marcus: what's the alternative?
21:28 mattastrophe joined #mojo
21:30 marcus sri: How about stringifying base?
21:30 marcus hmm, no, that break shit
21:36 sri yea, not breaking shit is the hard part ;)
21:43 jberger BREAK ALL THE THINGS!!!!
21:43 marcus yeah, i've been breaking a bunch of shit for the last 30 minutes
21:43 * jberger goes down in a blaze of glory
21:43 marcus Failed 8/84 test programs. 99/9512 subtests failed.
21:43 marcus this is one of my better results.
21:46 sri i can reduce url cloning costs by 30% :)
21:46 marcus (That's with   my $base = $url->base(Mojo::URL->new()->path($req->url->base->path)->host($req->url->host)->userinfo(undef));)
21:46 marcus sri: In general?
21:46 purl In general, you do not want to disturb The General.
21:47 sri yea
21:47 marcus That seems useful
21:47 sri https://gist.github.com/anonymous/7ef516a683456225676c
21:47 sri method calls are expensive
21:48 marcus oh, so my avoiding the method call for params. That seems ok
21:48 sri before and after benchmark https://gist.github.com/anonymous/957d079572199f77b04d
21:48 marcus How does it affect the mojo test suite as a whole?
21:49 sri that case seems representative of what's usually in the base url
21:49 marcus Yeah, it seems like a good optimization
21:49 sri no breakage
21:49 sri all pass
21:50 sri <3 n {...}
21:53 sri yea, it's actually an overall performance gain :)
21:54 mr-foobar joined #mojo
21:55 sri although, not that many places clone the whole URL :S
21:57 marcus hmm
21:58 marcus Path seems to have been optimized already tho
21:58 sri yea, a lot
21:58 sri and it's still way up there in the profiling stats usually
21:59 marcus request->clone calls url->clone tho
22:00 sri only used for user agent redirects though
22:00 marcus did you measure the gain for url_for in nytprof?
22:02 marcus I'm +1 for that url clone optimization anyways, just for the url_for gain
22:02 marcus Mojo::Headers::clone also seems like it could be less expensive btw
22:03 sri also only used for redirects as far as i know
22:04 sri nope, i did not nytprof it
22:05 jberger gah, I don't think I will ever figure out this reconnect carp
22:05 jberger certainly not while under the cpanday gun
22:06 jberger no Mojo::FriendFeed release today I guess :s
22:06 jberger hey, 1 for 2 aint bad I guess
22:07 marcus sri: I profiled it now. It pushes url_for below parse in a hello world benchmark
22:07 sri \o/
22:08 marcus (Mojo::Path::_parse)
22:09 sri found another optimization :)
22:09 marcus Ok, think I'm gonna throw all caution to the wind and install yosimite on my mac now.
22:09 sri can push my previous benchmark down to 0.16s
22:10 cpan_mojo joined #mojo
22:10 marcus sri: Gonna do nothing but $url->clone in my webapps from now on.
22:11 lb clonr
22:11 cpan_mojo Galileo 0.035 by Joel Berger - http://metacpan.org/release/JBERGER/Galileo-0.035 (depends on Mojolicious::Plugin::Memorize)
22:14 good_news_everyon joined #mojo
22:14 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/SA-zfA
22:14 good_news_everyon mojo/master a6b3b06 Sebastian Riedel: Mojo::URL can now be cloned twice as fast
22:14 good_news_everyon left #mojo
22:15 jberger sri++ marcus++
22:15 sri marcus++
22:17 sri marcus: were you only benchmarking url_for('/foo')?
22:17 sri or also url_for(some_route => {foo => 'bar'})?
22:17 sri the second is the really expensive one
22:20 sri a benchmark perl -Ilib -Mojo -E 'get "/foo/:bar" => "x"; my $c = app->build_controller; $c->req->url->base(Mojo::URL->new("http://example.com")); n { $c->url_for(x => {bar => "baz"}) } 10000'
22:21 sri 0.98s for 10k here
22:22 sri hmm... with url_for("/foo") it's 0.74s for 10k
22:22 woz joined #mojo
22:23 sri before the Mojo::URL optimization that benchmark was at 1.17s
22:24 sri and url_for("/foo") at 0.91s
22:31 Akron joined #mojo
22:38 sri i wonder how much we would benefit from those oo patches currently being discussed on perl5-porters
22:39 sri apparently the overall gain for big catalyst apps is 20-30%
22:57 good_news_everyon joined #mojo
22:57 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/-W6F8Q
22:57 good_news_everyon mojo/master 6b1b53a Sebastian Riedel: clone Mojo::URL a little faster
22:57 good_news_everyon left #mojo
22:59 hesco joined #mojo
23:24 woz joined #mojo
23:59 good_news_everyon joined #mojo
23:59 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/YaoTSw
23:59 good_news_everyon mojo/master 047c226 Sebastian Riedel: do not attempt to render parent routes without a pattern
23:59 good_news_everyon left #mojo
23:59 sri that's a 15% url_for increase for routes with segments that have no real pattern

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