Camelia, the Perl 6 bug

IRC log for #mojo, 2013-01-17

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

All times shown according to UTC.

Time Nick Message
00:00 human39 joined #mojo
00:00 good_news_everyone joined #mojo
00:00 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/5w47MQ
00:00 good_news_everyone mojo/master f0a4e01 Sebastian Riedel: documentation tweaks
00:00 good_news_everyone left #mojo
00:06 yakubori joined #mojo
00:12 Molaf__ joined #mojo
00:14 rem_lex| joined #mojo
00:14 atz joined #mojo
00:14 Adura joined #mojo
00:25 dvinciguerra joined #mojo
00:29 yakubori joined #mojo
00:41 rem_lex|pivo joined #mojo
00:53 jnbek joined #mojo
00:55 egopro joined #mojo
00:57 laouji joined #mojo
01:04 good_news_everyone joined #mojo
01:04 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/t1F6_Q
01:04 good_news_everyone mojo/master c0e6cd1 Sebastian Riedel: renamed pid_from_file to check_pid
01:04 good_news_everyone left #mojo
01:05 laidback_01 joined #mojo
01:11 Mike-PerlRecruiter_ joined #mojo
01:11 ka2u joined #mojo
01:13 egopro joined #mojo
01:15 d4rkie joined #mojo
01:15 hlin joined #mojo
01:19 ab joined #mojo
01:19 Miked joined #mojo
01:27 egopro joined #mojo
01:43 egopro_ joined #mojo
01:50 d4rkie joined #mojo
02:38 good_news_everyone joined #mojo
02:38 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/OzO8Uw
02:38 good_news_everyone mojo/master 6205af0 Sebastian Riedel: small optimizations
02:38 good_news_everyone left #mojo
03:07 noganex_ joined #mojo
03:55 KindOne joined #mojo
04:13 xaka joined #mojo
04:44 Caelum if I do a $c->param('foo', 'bar') in my under, then I have a route with a *foo, it gets overwritten :(
04:45 anewkirk that makes sense
04:45 anewkirk why not do a $c->stash->{foo} = 'bar'
04:45 Caelum because that also gets overwritten
04:46 Caelum the route param gets written to the stash too
04:46 anewkirk oh, damn
04:47 Caelum I'm tempted to write a plugin that fixes this
04:47 Caelum it would make my xml stuff much nicer
04:48 anewkirk (thinking)
04:49 * Caelum goes source diving
04:49 anewkirk I think that could be called a bug officially
04:50 anewkirk I understand it, but I don't think I would expect that to happen
04:50 Caelum holy shit, 5 releases since my last git fetch :)
05:00 mattastrophe joined #mojo
05:04 Caelum anewkirk: it's always a subject of much contention about what is a bug, and what should be expected to happen
05:04 Caelum anewkirk: my philosophy is to make software that's as DWIMMy as possible
05:06 ka2u joined #mojo
05:11 anewkirk Caelum, I agree
05:13 anewkirk I do understand that everytime the router resolves it sets the captures, but I wouldn't expect it to overwrite pre-existing captures
05:13 anewkirk (i don't know, this is a tough one)
05:17 ka2u joined #mojo
05:18 * sri disagrees, the current behavior is more dwim
05:19 sri if i define stash values at *this* stage, i expect them to get merged into the stash when the dispatcher reached *this* stage
05:19 sri it actually couldn't work any other way, but you're welcome to find that out yourself ;)
05:20 sri hint: controller, action and cb are stash values
05:21 jda2000 joined #mojo
05:22 jda2000 Hi all what does " Your secret passphrase needs to be changed!!!" mean?
05:23 sri http://mojolicio.us/perldoc/Mojolici​ous/Guides/FAQ#What_does_Your_secret​_passphrase_needs_to_be_changed_mean
05:23 anewkirk maybe its just a matter of perception where under/bridge and the route callback are perceived as one
05:23 jda2000 sri, Thanks!
05:24 jda2000 Wow! I asked that FAQ verbatim!
05:25 sri you're not the first :)
05:41 jberger FAQ defined
05:48 spleenjack joined #mojo
06:04 jda2000 How can i set a longer web socket  inactivity timeout value?
06:27 jda2000 anybody?
06:57 dpetrov_ joined #mojo
07:02 Adura joined #mojo
07:07 dpetrov_ joined #mojo
07:10 dhg joined #mojo
07:17 jda2000 left #mojo
07:21 shmuel joined #mojo
07:22 PanzerBjorn joined #mojo
07:23 shmuel hello mojo-people. is there a way to ask for the full URL from url_for?
07:23 PanzerBjorn Cheers, gents! Where does Mojo look for not_found.production.html.ep at?
07:23 PanzerBjorn I tried putting it in my temaples folder, and that didn't work.
07:23 PanzerBjorn templates, sheesh
07:24 shmuel I don't want only '/bla/bla...' but the full 'http://hostname/bla/bla...'
07:25 anewkirk PanzerBjorn, maybe the app isn't running in production mode
07:25 anewkirk ... try creating not_found.development.html.ep
07:26 PanzerBjorn It was, because it was logging to production.
07:26 dhg joined #mojo
07:29 PanzerBjorn Ahhh, there's the issue. It's trying to render through the default layout, which isn't getting populated with what it needs due to not getting a valid route...
07:32 Vandal joined #mojo
07:32 shmuel $self->req->url->host returns an empty string.
07:33 shmuel (I develop on localhost)
07:33 PanzerBjorn Did you check the headers?
07:33 PanzerBjorn (For something useful, I mean.)
07:35 dotan joined #mojo
07:36 baton8 joined #mojo
07:37 shmuel GET /~sfomberg/cgi-bin/lang_colleb/app.pl HTTP/1.1
07:37 shmuel Host: localhost
07:37 shmuel PanzerBjorn: that what was in the headers.
07:37 shmuel $self->req->url itself is a "\n"
07:39 laouji joined #mojo
08:03 dod joined #mojo
08:16 ver joined #mojo
08:16 ghandi joined #mojo
08:16 ghandmann joined #mojo
08:19 ghandmann Hi There, i'm using Mojo with DBIx::Class via the "has 'schema'"-Approch (http://mojoexample.herokuapp.com/). But large DB-Results start to eat more and more chunks of memory (up to 300mb) and will not vanish after the request has been served. Is there any other way of including DBIx::Class into Mojo without this sideeffect?
08:25 tempire joined #mojo
08:34 dod joined #mojo
08:47 baton8 joined #mojo
08:49 ObseLeTe joined #mojo
08:57 PanzerBjorn @ghandmann: Do you really need all the overhead of DBIx::Class? I just use DBIx::Connector for my Mojo implementation and it works fine even for large results.
09:01 davehorner joined #mojo
09:18 ulric joined #mojo
09:22 kitt_vl joined #mojo
09:30 cosmincx joined #mojo
09:45 Kovensky joined #mojo
09:57 dpetrov_ joined #mojo
10:18 fhelmber_ joined #mojo
10:19 nicomen spent 755ms (458+297) within Mojolicious::Routes::Route::find which was called 196 times
10:19 nicomen ^-- this is for one get / request, what on earth am I doing wrong?
10:20 nicomen seems it comes mostly from url_for
10:21 nic Can you give us an ultra minimal example to play with?
10:23 nic ghandmann: Does your model layer change a lot from request to request?  If so, might want it owned by the controllers.  But if it's essentially the same model, having it owned by the app makes sense
10:24 nicomen nic: yeah, but I think it's just that I have 196 routes, and going thru all simply take time
10:25 nicomen hm, or not
10:26 nicomen seems url_for helper call in TT is not cached
10:30 Vandal BTW it not always walking right, regarding https://twitter.com/AFresh1​/status/291565675359637507
10:39 nicomen also, with hypnotoad, it seems it is triggering a relaod of the app when I change a file, how do I turn off that again?
10:41 suy joined #mojo
10:45 vervain I didn't think that hypnotoad 'watched' files.  I could be wrong.
10:49 nicomen no it's probably mojo
10:49 vervain 'morbo'?
10:49 nicomen but it could be that I need to set MOJO_MODE=production or somethiing?
10:50 vervain morbo automatically reloads on file changes, hypnotoad does not ( I'm pretty sure )
10:52 bizam hi! how to get current route object within hook before_dispatch if possible?
10:53 nicomen vervain: ok, but something is wrong here since when I changed a template, it was applied live
10:53 nicomen I thought TT ignored that
10:54 vervain bizam: Seems to me that before_dispatch is before router selection.
10:55 Caelum sri: how does the dispatcher set the param for a placeholder?
10:56 vervain nicomen: <shrug> dunno.  But it could easily be reloading the templates on render, but not the whole app.
10:57 nicomen but it's really disappointing that using url_for('some.route', bar => 'lol') everywhere gives such a performance hit, "fixed" a loop that was generating urls like that (using [% url = h.url_for('some.route') %] [% FOR loop %] [% url _ "/" _ "bar/lol" %], and went from 760ms to 368ms
10:57 Caelum catalyst had the same problem
10:57 Caelum they really optimized uri_for, but it still sucks
10:57 bizam vervain: sorry, which hook can get current route?
10:58 vervain after_dispatch maybe?
10:59 judofyr joined #mojo
11:00 bizam vervain: no, "after_dispatch  Emitted in reverse order after a response has been rendered."
11:01 bizam i need hook right before controller must work
11:02 Caelum sri: never mind, figured it out
11:02 vervain bizam: Not sure then.  Seems you probably already have more practical experience with them than I.
11:06 dhg joined #mojo
11:07 bizam after_dispatch hook work after controller#action done
11:09 bizam which hook before controller#action begin AND can access to current route?
11:11 vervain bizam:  Perhaps you could describe what it is you are wanting to achieve, perhaps someone can suggest an other way to approach it.
11:17 bizam i want to do some action with current route for all request before 'controller#action' will be started
11:18 bizam *all requests
11:19 bizam *some 'controller#action' will be started
11:22 bizam *before some ::Controller class will be loaded
11:23 vervain how about a bridge or nested route?
11:24 vervain Oh... 'with current route'. What is it that you want to do to the route?
11:25 bizam let's get namespace
11:26 bizam get $c->match->endpoint->pattern->defaults
11:33 vervain Get it and do what with it?
11:35 bizam get it
11:36 vervain Without context I can't help any more.  Someone smarter will be along shortly.
11:37 vervain I have to assume that 'get it and do nothing with it' is pointless. :-)
11:39 ObseLeTe joined #mojo
11:41 bizam lets 'use lib "$FindBin::Bin/../<some>/<where>/$namespace";' (i know about $app->namespaces)
11:47 bizam okay, impossible
11:49 ladnaV joined #mojo
11:49 * bizam want excessively many hooks
12:06 jwang joined #mojo
12:36 davehorner joined #mojo
12:46 bpmedley_ joined #mojo
13:03 mattastrophe joined #mojo
13:11 d4rkie joined #mojo
13:11 Mike-PerlRecruiter_ joined #mojo
13:13 dod joined #mojo
13:16 dod joined #mojo
13:38 dod1 joined #mojo
13:47 TitanOfOld joined #mojo
13:47 keedi joined #mojo
13:55 dod joined #mojo
14:07 al802 joined #mojo
14:08 al802 I have a helper that returns html, but when I reference that helper in the templates it works, but the help is escape; how can I prevent this?
14:08 dod joined #mojo
14:10 al802 help=html
14:11 dod joined #mojo
14:12 vervain http://mojolicio.us/perldoc/Mojolic​ious/Guides/Rendering#Embedded_Perl
14:12 vervain Specifically <%== helper_foo() %>
14:13 asarch joined #mojo
14:14 al802 that worked, thanks
14:21 Miked joined #mojo
14:25 ObseLeTe joined #mojo
14:28 ulric left #mojo
14:43 jwang joined #mojo
14:54 jwang joined #mojo
14:55 kwa joined #mojo
14:56 kitt_vl joined #mojo
15:16 Britzel joined #mojo
15:18 ryozi joined #mojo
15:18 sri bizam: such a hook does not exist yet, but i've actually proposed one like that before, the only problem is that we don't have good use cases for it
15:19 sri so, if you present one or two good use cases, odds are it will get added
15:53 sri nicomen: try this patch http://pastie.org/5708171 does it make url_for fast?
16:13 Grauwolf joined #mojo
16:13 Grauwolf hi!
16:13 judofyr hi Grauwolf
16:17 Grauwolf i've got a problem. http://nopaste.narf.at/show/UhpZyN9DmRRwPfVKWPz2/ and when i start the app directly via `hypnotoad app.pl` it works. when i start it via an initscript i get "Hypnotoad config files are DEPRECATED!"
16:18 Grauwolf excerpt of the initscript: http://nopaste.narf.at/show/bRJBBDMgKdQcEOYoKsNb/
16:18 Grauwolf any ideas?
16:18 Grauwolf version is mojolicious 3.80
16:19 bjoernfan Multiple hypnotoads on your system?
16:19 sri Hypnotoad config files are DEPRECATED! is pre 3.0
16:19 bjoernfan Hypnotoadi
16:20 Grauwolf bjoernfan: multiple hypnotoads it is. thanks :D
16:21 nicomen sri: thanks, will try
16:21 bjoernfan hoooray
16:22 asarch joined #mojo
16:23 labrown joined #mojo
16:30 nicomen sri: went from 4 seconds to 0.18 seconds for a test case here, so would say yes
16:31 nicomen ;)
16:31 gryphon joined #mojo
16:32 atz joined #mojo
16:34 sri nicomen: interesting
16:35 sri our route cache only has space for 100 keys though, so if you go through 101 named routes performance should get worse than before
16:35 atz_ joined #mojo
16:36 sri you could test with $app->routes->cache->max_keys(10) or so
16:36 judofyr sri: isn't the route cache also used for route lookups?
16:36 sri it is
16:36 atz__ joined #mojo
16:36 judofyr sri: so it will probably not speed up so much if you have a lot of varied traffic
16:36 nicomen sri: I used 1000 routes, with 1000 url_for calls
16:37 sri nicomen: very odd
16:37 sri i don't see how it could speed up lookups there
16:38 sri judofyr: yes
16:38 nicomen ah no wait
16:38 sri i've thought about smarter invalidation in the cache... but that doesn't really help with too many url_for calls
16:39 sri other alternative would be a permanent cache mapping route names to route objects
16:39 nicomen let me send you my test case
16:39 sri compared to caching dispatch results it would be dirt cheap
16:41 nicomen sri: http://pastie.org/5709234
16:41 judofyr sri: yeah, I think a permanent cache makes sense. you could even set it up in the ->name(…) setter
16:43 sri nicomen: http://pastie.org/5709242 # here's the permanent version
16:44 basic6 joined #mojo
16:44 sri judofyr: won't work sadly
16:44 sri (->name() setter)
16:44 anaio joined #mojo
16:44 judofyr sri: oh? :-(
16:45 nicomen sri: same speed difference
16:45 sri route names can be auto generated, and there can be duplicates
16:46 sri and routes can be shuffled around before the first request
16:46 nicomen true
16:46 sri so we don't know which one will actually match the name when ->name() gets called
16:46 nicomen I guess a $r->freeze() would make sense
16:47 sri documentation says routes are frozen after first request
16:47 nicomen ah
16:47 sri nicomen: your results are very odd
16:48 sri the previous patch couldn't have given you that speedup
16:48 nicomen sri: can you try to reproduce with my code?
16:50 sri nicomen: if you give me something i can actually run
16:50 nicomen http://pastie.org/5709234 <-- doesn't work?
16:50 sri what is that supposed to be?
16:51 nicomen a mojo app
16:51 bluescreen joined #mojo
16:51 sri it's not runnable code
16:51 nicomen but ok, could reduce to a line or something
16:51 nicomen but need to go
16:52 sri ...
16:52 dod joined #mojo
16:53 sri maybe someone else wants to figure this out, i'm off too now
17:00 basic6 left #mojo
17:12 dod joined #mojo
17:15 xaka joined #mojo
17:46 dhg joined #mojo
17:53 Akron joined #mojo
18:07 sri http://pastie.org/5710179 # here's a possible patch, it will only get applied if there is feedback though
18:09 * sri pokes marcus, tempire and crab
18:19 sri http://pastie.org/5710224 # somehow the previous patch got messed up
18:21 sri i'm gonna upload a new release later, up to you if you want it included
18:22 Ultali joined #mojo
18:24 ka2u joined #mojo
18:47 dhg joined #mojo
19:15 dpetrov_ joined #mojo
19:20 tempire 196 calls of url_for!
19:21 * tempire prefers to stay under 195
19:21 sri http://pastie.org/5710619 # here's also a real benchmark
19:22 sri equivalent to 20 requests with 100 url_for calls each in the middle of the routes tree
19:22 sri 0.2s uncached, and around 0.01 cached for all 100 calls
19:23 * sri is a little surprised lookup is so expensive compared to rendering the path
19:25 sri ah right, auto generated route name means worst case every single time, since it has to try all 1000 routes
19:28 sri with route names it is 1.82s vs 0.45s
19:32 al joined #mojo
19:34 sri tempire: just to be clear, you're in favor of the optimization?
19:44 tempire I don't see any downsides
19:44 tempire so yes.
19:45 ka2u joined #mojo
19:45 good_news_everyone joined #mojo
19:45 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/tKmT8A
19:45 good_news_everyone mojo/master 7fba4e9 Sebastian Riedel: added lookup method to Mojolicious::Routes and improved url_for performance significantly
19:45 good_news_everyone left #mojo
19:45 sri ok :)
19:52 BeDa joined #mojo
19:58 gryphon joined #mojo
20:00 basic6 joined #mojo
20:10 travis-ci joined #mojo
20:10 travis-ci [travis-ci] kraih/mojo#185 (master - 7fba4e9 : Sebastian Riedel): The build was broken.
20:10 travis-ci [travis-ci] Change view : https://github.com/kraih/mojo/com​pare/6205af00d150...7fba4e951150
20:10 travis-ci [travis-ci] Build details : http://travis-ci.org/kraih/mojo/builds/4216282
20:10 travis-ci left #mojo
20:10 nicomen just came back, nice, thanks guys ;)
20:10 nicomen oh broken build..
20:11 nicomen Executing your  (mkdir -p kraih/mojo) took longer than 3 minutes and was terminated.
20:12 nicomen nfs issues of some sort?
20:19 vervain joined #mojo
20:23 vervain_ joined #mojo
20:26 good_news_everyone joined #mojo
20:26 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/jf2drw
20:26 good_news_everyone mojo/master d1d2c91 Sebastian Riedel: documentation tweaks
20:26 good_news_everyone left #mojo
20:28 Caelum sri: would you accept a pr that moves the captures saving out of ::Controller::_walk into a hook of some sort?
20:28 sri Caelum: unlikely
20:29 sri we usually only add a new hook if there are at least two good use cases
20:29 Caelum I'd really like to override this somehow, but overriding the whole of _walk really sucks
20:29 Caelum or just a method? doesn't have to be a hook
20:29 sri did you read what i wrote yesterday?
20:29 Caelum yeah?
20:30 sri you're breaking half of the framework
20:30 sri for pretty much no gain
20:30 Caelum not really, I just want '' captures to not get saved if there is already something there
20:31 Caelum that would make my xml processing much more beautiful
20:31 sri and that breaks half the framework
20:31 sri seriously, just try hacking it into core and run the tests
20:31 Caelum ok
20:32 sri i'm all for adding new hooks to the router btw. they just need two good use cases each
20:36 sri btw. merging captures originally worked the way you want, but caused *a lot* of trouble in the pre 1.0 days
20:47 lukep joined #mojo
20:56 mattastrophe joined #mojo
20:56 travis-ci joined #mojo
20:56 travis-ci [travis-ci] kraih/mojo#186 (master - 326eb01 : Sebastian Riedel): The build was fixed.
20:56 travis-ci [travis-ci] Change view : https://github.com/kraih/mojo/com​pare/7fba4e951150...326eb01da336
20:56 travis-ci [travis-ci] Build details : http://travis-ci.org/kraih/mojo/builds/4216973
20:56 travis-ci left #mojo
20:56 mojobot18657 joined #mojo
20:58 Caelum sri: https://gist.github.com/4559690
20:59 Caelum sri: but maybe I'm better off just overriding ->param for what I need
21:02 Caelum btw, what is the 'data' stash key used for officially?
21:05 sri looks like you've found a hole in the tests
21:05 sri that patch shouldn't work
21:13 Caelum I'm just going to set an xml_data stash key and do an around param
21:13 sri not sure i understand what the patch actually does
21:13 sri it doesn't do what you said it would do at least
21:16 sri anyway, if you don't care anymore either there is no point trying to find out
21:16 rhaen_fork joined #mojo
21:17 Caelum sri: well, you saw my test? I do a $c->stash(foo => 'bar') in my under, and the 'bar' doesn't get overwritten by the '' from the capture in the stash
21:18 sri if you're only making '' a special case, that would be inconsistent but harmless i suppose
21:20 travis-ci joined #mojo
21:20 travis-ci [travis-ci] kraih/mojo#187 (master - d1d2c91 : Sebastian Riedel): The build was fixed.
21:20 travis-ci [travis-ci] Change view : https://github.com/kraih/mojo/com​pare/326eb01da336...d1d2c910472f
21:20 travis-ci [travis-ci] Build details : http://travis-ci.org/kraih/mojo/builds/4217007
21:20 travis-ci left #mojo
21:30 good_news_everyone joined #mojo
21:30 good_news_everyone [mojo] kraih tagged v3.81 at 19039e3: http://git.io/UpYtyw
21:30 good_news_everyone left #mojo
21:30 sri game over, no more changes :)
21:34 xaka joined #mojo
21:36 buu MOJOLICIOUS
21:36 buu "Sir, I think you dropped your mojo"
21:38 Caelum hi buu
21:39 mattastrophe joined #mojo
21:40 Caelum how's life?
21:44 Grauwolf left #mojo
21:46 Caelum woo, it works
21:46 Caelum hooray for Class::Method::Modifiers
21:47 Caelum hmm, can I just change what controller class the app uses?
21:59 Caelum sri: remember that getpost example you deleted? I couldn't find it in my irc logs so I made my own: https://gist.github.com/4560212
22:00 sri https://gist.github.com/4342795
22:00 sri that stuff is usually in my gist history
22:01 Caelum ah thanks!
22:02 sri for a few minutes it was even a cookbook recipe... but it was too hack-ish
22:03 sri https://github.com/kraih/mojo/commit/f5​e97f55fbd0788af812a2c39e84ada04c2a39e0
22:04 sri it sure is fun for advanced users, but it's so easy to break stuff with it
22:06 sri my example doesn't work with group and under for example...
22:06 sri your version is better for that ;)
22:25 vervain joined #mojo
22:26 vervain With Moo::Role and "requires 'foo'" I don't seem to be able to get away with just the accessor created by 'has 'foo' ( is => 'ro', ... )'
22:26 vervain the accessor in the class that is.
22:31 vervain Whoops... wrong channel 8-|
22:36 jberger joined #mojo
22:38 Caelum vervain: that's because your accessor is created at runtime, while the role is loaded at compile time
22:39 Caelum vervain: you need to do: BEGIN { with 'Role'; }
22:39 Caelum this is such a common question on #moose
22:40 vervain I ended up just moving my "with 'foo'" to after my required definitions.  is that ok too
22:40 vervain ?
22:40 Caelum vervain: yeah that's fine too
22:41 vervain I do like the idea of BEGIN  better since I can put the statement in a more 'relevant' part of the file.
22:41 Caelum really, these kinds of methods need to be BeginLifted, but people are scared of things like that
22:42 Caelum catalyst now makes you write: BEGIN { extends 'Catalyst::Controller'; }
22:42 Caelum really fucking ugly
22:44 vervain Hmmm... BEGIN has the same problem.  Putting it at the end works ok though.
22:45 Caelum really? that's interesting
22:47 Caelum oh because the accessor needs to be created before the role is loaded
22:52 lammel2 joined #mojo
23:02 Miked joined #mojo
23:08 rem_lex| joined #mojo
23:10 Averna joined #mojo
23:16 rem_lex joined #mojo
23:58 jzawodn joined #mojo

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