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

IRC log for #mojo, 2015-03-18

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

All times shown according to UTC.

Time Nick Message
00:02 disputin joined #mojo
00:22 disputin joined #mojo
00:26 DaTa joined #mojo
00:55 hshong joined #mojo
01:12 sri just asked in #toolchain... but maybe someone here knows too... is there an easy way to move old versions of a dist from backpan to cpan again?
01:14 sri installing old versions of mojolicious with carton/cpanm is a pretty big security issue
01:17 sri wonder if i can just reupload old dists
01:17 sri like the last 200
01:17 sri or if that would mess up metacpan
01:18 sri or even get rejected by pause
01:18 Zoffix Rejected
01:18 sri wow, that is actually pretty bad if true
01:18 mattastrophe joined #mojo
01:20 Zoffix It is: http://i.imgur.com/m8Zzhuu.png
01:21 Zoffix I believe this is for security reasons...
01:21 sri lol
01:26 Grinnz lol
01:28 Zoffix wat? :)
01:31 sri one good thing... "cpanm -M https://cpan.metacpan.org --installdeps ." bails if it can't find the right version on cpan
01:31 sri but only if you have LWP::Protocol::https installed, otherwise it falls back to http and installes happily from backpan
01:32 sri anyway, i believe we can't recommend carton anymore
01:32 * sri pokes jberger
01:33 sri or pinning apps to a certain version of mojolicious with a cpanfile
01:33 jberger :o
01:34 sri best you can do might be checking out the tags from github manually
01:35 Zoffix <sri> installing old versions of mojolicious with carton/cpanm is a pretty big security issue
01:35 Zoffix How come? What's the issue?
01:35 sri because backpan has no https or checksums
01:36 Zoffix Ah
01:36 sri not that unsigned checksums on backpan would help much
01:38 sri or the checksums on cpan for that matter... but that's a different security nightmare ;p
01:39 sri (checksums pretty much just don't work, and all we have regarding security atm. is the metacpan https mirror of cpan)
01:40 sri which was how we got to add the -M flag to cpanm and recommend this one-liner on the frontpage "curl -L https://cpanmin.us | perl - -M https://cpan.metacpan.org -n Mojolicious"
01:45 jberger but if there is nothing else that we can recommend
01:45 jberger you don't actually expect that people that install via CPAN will always install via that one liner
01:46 jberger I kinda like that github tag
01:46 sri i hope they'd use -M https://cpan.metacpan.org though
01:47 jberger if they use carton bundle and all pure-perl modules, they're fine :-)
01:47 sri it's not like this is a theoretical attack vector
01:47 jberger (assuming they built the bundle with https)
01:48 sri we know from the nsa docs that they inject stuff this way, tor exit nodes are also known to rewrite zip files passing through
01:48 jberger sri: understood, but we don't have great options apart from it
01:48 jberger hmmmm
01:48 mst crab: G_S_M has repeatedly said it's unforutnuante how the default is set
01:48 mst crab: 0 is correct AFAICS
01:49 mst crab: please correct me if I'm wrong wrt pg_server_prepare
01:49 mst sri: ^^ above should resolve the question
01:50 sri mst: i still would like to see some decent benchmarks to resolve the question once and for all :)
01:50 jberger sri: sadly, even if Mojolicious is always installed via https 100% of the time, almost no one else has signatures on CPAN
01:50 sri signature checks don't work anyway
01:50 jberger so if they use even one other CPAN module, the attack vector is still there
01:50 * jberger sighs
01:51 mst sri: sure, but given the horrible truth, that's the best answer I can give you
01:51 sri just remove them in your replacement tarball and nothning happens
01:58 sri i have a feeling all benchmarks will end up looking pretty weak
01:58 sri crab: anyway, if you want to give it a try, this branch should have fully functioning sth caching support https://github.com/kraih/mojo-pg/compare/caching
01:58 sri or anyone else, just benchmark that branch against master
02:05 sri mst: did you catch this? http://irclog.perlgeek.de/mojo/2015-03-17#i_10296368
02:05 sri i found that quite interesting
02:06 mst sri: it fucked me repeatedly
02:06 mst simple situation
02:06 purl rumour has it simple situation is this. I didn't escape quotes when I inserted the data in the database. I think DBIC did. I need to know of the right way to unescape the quotes
02:06 Zoffix Woohoo \o/ For the first time in history... I managed to launch a Mojolicious site... or any site that wasn't a CGI script.
02:06 Zoffix Level up \o/
02:06 mst consider a table that has a single 'current' true/false column
02:06 sri http://neverwintervault.org/sites/neverwintervault.org/files/project/3195/images/6a017c33f9354f970b017c36faf996970b-800wi.jpg
02:06 mst pg_server_prepare says "this query might be used with true or false"
02:07 Zoffix :)
02:07 mst so even if true is index lookup-ablew
02:07 mst it table scans
02:07 mst keeping the bind values when you ask the plannerr
02:07 mst lets it decide correctly
02:08 mst sri: maybe that's fixed on newer postgres, but I've never heard an investigation of that that proved it true
02:08 sri crab: *poke*
02:08 mst I could easily be totally wrong here
02:09 mst crab will point it out if I am
02:15 klapperl_ joined #mojo
02:21 mattastrophe joined #mojo
02:24 serderperder joined #mojo
02:40 jberger Zoffix: congrats
02:40 purl Indeed, well played sir.
02:40 Zoffix jberger, thanks... it took me a year :)
02:40 jberger though I must say, is have a much harder time deploying a cgi site these days
02:42 jberger s/is/I'd/ # damn why do I even try to irc from my phone
02:48 sri look at that, cpan.metacpan.org is actually a backpan https://cpan.metacpan.org/modules/by-authors/id/S/SR/SRI/
02:49 sri cpanm just doesn't use it
02:50 sri so directly installing with full url should be fine
02:50 hshong joined #mojo
02:50 Zoffix And I don't know whose idea it was to make Mojolicious function as a single file that can be later inflated into separate files, but that's pure genius. It's what kept me struggling with Catalyst. Reading the tuts for it was always like "you got a shitzillion of files and let's write tests and we got DBIx helpers!!" and I was like, "man, I just wanna make a website". Mojolicious totally does that.
02:51 sri \o/
02:51 sri it actually wasn't really an idea, more of a process
02:51 Zoffix :)
02:52 sri i was having trouble documenting full apps... because yea, ALL THOSE FILES!!!
02:52 sri so this happened https://github.com/kraih/mojo/blob/master/t/mojolicious/lib/SingleFileTestApp.pm
02:52 sri and then the rest grew on top of that :)
02:53 Zoffix :D
02:54 DesertFox From that description I'm glad I havn't had to touch catalyst.
02:55 DesertFox k brb beerz
03:15 noganex_ joined #mojo
03:17 DesertFox o.O
03:17 DesertFox Stranger danger.
03:20 DesertFox crisis adverted gents
03:20 jberger ha! reply->static
03:20 jberger DesertFox: good job
03:21 DesertFox lol
03:25 cpan_mojo Mojo-Pg 1.15 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojo-Pg-1.15
03:31 sri oh, that's neat, you can see the exmaple structure very well https://metacpan.org/release/SRI/Mojo-Pg-1.15
03:32 DesertFox Indeed.
03:32 purl indubitably
03:35 sri it's funny how i was worried about running out of ids for jobs in minion with postgresql
03:37 sri with a bigserial you would have to add 292271023 jobs per second to run out of ids in 1000 years :D
03:39 * jberger start cranking
03:42 borick joined #mojo
03:43 borick hello!
03:44 boris joined #mojo
03:44 DesertFox Happy stpattys.
03:45 boris hello im trying to write an app with websocket is there anyway i can talk to websocket client from another another controller function, like do a send to connected websocket client on another controller hit ?
03:48 jberger boris: just for a demo and only with a single server, just store the own connections in a hash and distribute as necessary
03:49 jberger but as soon as you want to do anything really you need a db backing it as a message broker
03:49 jberger see for example this one
03:49 jberger https://metacpan.org/source/SRI/Mojo-Pg-1.15/examples/chat.pl
03:50 jberger and I have a similar one for redis
04:01 basic6_ joined #mojo
04:11 Oleg joined #mojo
04:13 alexbyk joined #mojo
04:25 inokenty-w joined #mojo
04:43 Eke- joined #mojo
04:53 irq joined #mojo
04:55 sri lololol http://welcometobusinesstown.tumblr.com/
04:55 crab mst: i'm not talking about setting pg_server_prepare to 1, but about being *able to* use prepared statements if you want to.
04:58 sri crab: why would you want prepared statements without setting pg_server_prepare to 1?
04:59 sri decide on a query by query basis?
05:00 basic6 joined #mojo
05:01 sri i guess $db->prepared->query(...) is pretty trivial, but the performance question is still open
05:03 crab sri: yes
05:04 crab 03:44  <crab> it may be sensible to only server-prepare specific statements that you want server-prepared, so i'm not making a blanket assertion.
05:04 davido_ joined #mojo
05:05 * sri still would like to see a real example where it makes a significant difference
05:07 crab sri: ok, i'll find one and extract it into a testcase. (but it won't be today)
05:10 crab (such things are typically non-trivial by their nature, e.g. i'd be surprised to find a really convincing one that works on an empty or small table)
05:10 crab but i'll find something.
05:11 crab also, the other problem is that libpq, and therefore DBD::Pg, doesn't support pipelining (the way, e.g. pgjdbc does).
05:12 crab anyway.
05:13 sri well, we're not in a hurry
05:14 sri not like it's a life changing feature
05:14 sri the complexity of the code actually worries me
05:16 sri if it's only useful for a few very minor use cases i think i'd rather not have it
05:20 crab mst: btw, post 9.2 what you're saying should not be true any more. "Allow the planner to generate custom plans for specific parameter values even when using prepared statements" from the 9.2 release notes.
05:20 crab mst: "Rewrite plancache.c so that a "cached plan" (which is rather a misnomer at this point) can support generation of custom, parameter-value-dependent plans, and can make an intelligent choice between using custom plans and the traditional generic-plan approach. The specific choice algorithm implemented here can probably be improved in future, but this commit is all about getting the mechanism in place, not the policy." <- commit from sep 2011
05:24 crab (this is different from the change i mentioned before, which is "Protocol-level unnamed prepared statements are re-planned for each set of BIND values (Tom)" from 8.2)
05:24 crab that one, i'm not sure DBD::Pg can take advantage of (but i haven't looked at the code)
05:32 crab hrh
05:35 crab i'd forgotten that i wrote PQprepare.
05:37 crab ok, looks like DBD::Pg always names the portal for the statements it prepares. so the change i was talking about earlier doesn't benefit it, but the 9.2 one does.
05:37 crab anyway, no more time for this today. later.
05:37 melo joined #mojo
05:38 alexbyk joined #mojo
05:39 alexbyk joined #mojo
05:39 alexbyk joined #mojo
05:40 crab though i really wonder if anyone has a convincing _counterexample_, i.e. a case where using prepared statements results in a performance loss.
05:40 cpan_mojo Clustericious 0.9945 by PLICEASE - http://metacpan.org/release/PLICEASE/Clustericious-0.9945 (depends on Mojolicious)
05:41 melo1 joined #mojo
05:43 sri it would be a lot less questionable if prepare_cached just worked
05:44 crab does it not?
05:45 crab mst: btw, here's GSM on the subject: http://blog.endpoint.com/2014/04/custom-plans-prepared-statements-in.html
05:45 sri does it with pg_async?
05:46 crab «The moral of the story: don't settle for anything less than version 9.2 of Postgres!»
05:47 crab sri: don't know about prepare_cached and pg_async. will have to check.
05:48 sri well, just replacing prepare with prepare_cached seems to break tests, good sign :)
05:55 sri connect_cached is already useless for us
05:57 reneeb joined #mojo
06:10 marcusr Oslo finally has network coverage all through my subway ride. It's brilliant
06:10 marcusr I can save an extra hour of work each day.
06:14 sri more time for irc \o/
06:30 reneeb joined #mojo
06:37 Eke- joined #mojo
06:44 marcusr joined #mojo
07:12 dod joined #mojo
07:14 Onigiri joined #mojo
07:18 dod joined #mojo
07:23 marmez joined #mojo
07:24 bramirez joined #mojo
07:25 DaTa joined #mojo
07:42 marcusr joined #mojo
07:52 marcusr joined #mojo
08:02 fhelmber_ joined #mojo
08:17 Vandal joined #mojo
08:19 eseyman joined #mojo
08:19 AndrewIsh joined #mojo
08:34 irq joined #mojo
08:43 crab ah, some proof that prepared statements help:
08:43 crab pgbench -S -t 10000 -M simple => 703 tps
08:44 crab pgbench -S -t 10000 -M prepared => 1264 tps
08:44 crab (pgbench -i -s 100 to initialise)
08:47 bramirez joined #mojo
08:47 stl joined #mojo
08:55 crab no, that's bad. -t is bad. and crab is bad, and should feel bad.
08:58 crab better: "pgbench -S -c 10 -j 10 -T 100 -M simple" vs. "... -M prepared"
08:59 crab in a 100s test, using -M simple does 3586412 transactions; -M prepared does 5913996. 35861.772237 tps vs. 59139.962247 (now with a hot cache).
09:00 crab mst: btw, andres, whom you can trust more than me, says that the 9.2+ custom plan thing isn't perfect, but there's certainly no call for "avoid prepared statements at all cost" any more.
09:01 crab and now, back to work.
09:08 trone joined #mojo
09:25 shadowpaste "ashimema" at 217.168.150.38 pasted "iterating through a has_many" (6 lines) at http://paste.scsys.co.uk/469786
09:25 ashimema wrong channel.
09:25 ashimema bugger
09:25 ashimema apologies
09:25 purl apologies are in order, then.
09:30 OmarOthman joined #mojo
09:37 alexbyk joined #mojo
09:45 alexbyk I was wondering could Mouse improve performance of my app and decided to write a benchmark with the simple average usage Moo vs Mojo::Base vs Mouse vs Moose ...
09:45 alexbyk Looks like with the latest perl 5.21.9 Mojo::Base is the winner in that company) https://github.com/alexbyk/perl-bench-oo/blob/master/results-5.21.9-i7-3770-except-moose.txt
09:47 OmarOthman1 joined #mojo
09:51 punter joined #mojo
09:54 nicomen alexbyk: what are you measuring?
09:54 nicomen and what is Pure?
09:54 purl Pure is the enemy of relaxing @ the pub :)
09:58 Lee alexbyk: https://github.com/leejo/code/blob/master/script/moooooooo_benchmarks.out
09:58 * Lee updates for 5.21.9
09:58 Lee generated from https://github.com/leejo/code/blob/master/script/moooooooo_benchmarks.pl
09:59 Lee given that the "slowest" manages 297766.75/s i would contend this is micro-optimsation :D
10:05 alexbyk Lee: now always) I'm working on shop Angular+Mojolicious it can handle about 10K customers online. So while server app doesn't do much, the bottleneck is the performance of OO. Thanks for the link
10:05 alexbyk *not
10:08 Lee alexbyk: indeed. FWIW i see the same results with 5.21.9 (except Moose, which won't install due to downstream dep failures)
10:23 OmarOthman joined #mojo
10:24 dotan joined #mojo
10:33 mattastrophe joined #mojo
10:38 arpadszasz joined #mojo
10:55 Kripton joined #mojo
11:06 ashimema silly question.. how do I detect from a controller whether I'm in a get or a delete request?
11:07 ashimema sure i've just missed it in the docs.. it must be obviose
11:07 neilhwatson joined #mojo
11:08 crab $c->req->method?
11:08 ashimema that'd be the ticket..
11:08 ashimema how did I miss it in the docs :!
11:08 ashimema cheers
11:10 crab maybe it's punishment for routing a get and a delete to the same handler ;-)
11:11 ashimema indeed.. it's not often I do.
11:12 ashimema just seemed most appropriate in this case ;)
11:14 romel hi guys. i am wondering if it's possible to shorten my routes declaration somehow: http://pastie.org/10034893 as far as i understand, since intermediate routes itself cannot match requests, it doesn't look very ugly
11:15 romel the main goal is to handle requests for /catalogue , /catalogue/page/1, /catalogue/view/1 and /catalogue/view/1/page/1
11:21 crab romel: why do you have the under at all?
11:26 romel it remaied after my numerous experiments :)
11:26 marmez joined #mojo
11:30 amon joined #mojo
11:50 trone any hint about how transform perl data struct to json without lose the numeric lvalue?
11:51 trone I'm using $self->render( ..., json => { ..., thing => \%my_hash } ) and all json values become strings.
11:54 trone Sic. If I do a test as this my %test = (a=>1,b=>2,c=>3); $self->app->log->debug('test: ', Mojo::JSON::encode_json(\%test)); and also render that \%test, all works properly (numbers are numbers)
11:55 trone but if value come from my object method it is string. however mojo make it right.
11:58 bramirez joined #mojo
12:11 jberger trone: the mechanism to tell if a value should be a string or number in Perl is difficult
12:11 jberger because perl is inherently typeless
12:12 jberger internally you can tell if a scalar has ever been used as a string
12:13 jberger and iirc this is how mojo json heuristically guesses which tip use
12:13 jberger to
12:13 nicomen does Mojo::JSON come with a: "traverse and numify values that like numbers" method  you could use on your object?
12:14 jberger nicomen: does any json encoder?
12:14 nicomen jberger: well, I'm thinking since it already does that right?
12:16 jberger nicomen: you can't arbitrarily use scalars that look like numbers as numbers
12:16 ribasushi my $zip = '01234' #whoops
12:17 nicomen jberger: ah right
12:17 jberger or anything that you have sprintf ed
12:18 nicomen can you tell perl, that "this value shall forget it has ever been used as a string" ?
12:18 jberger nicomen: not sure
12:18 nicomen "unflag it" so to speak
12:19 jberger you can check for some B function
12:24 niczero joined #mojo
12:26 crab SvPOK_off(sv)
12:26 crab :-)
12:27 niczero the favicon.ico that comes with Mojolicious: "MS Windows icon resource - 2 icons, 24x24, 256-colors"
12:27 niczero anyone know why the 2 icons?
12:27 niczero (I know zip about .ico files)
12:28 crab they're two frames of an animation
12:28 niczero ah
12:28 nicomen it's the common denominator that all browsers support AFAIK
12:28 crab (i'm just kidding, i have no idea :-)
12:28 niczero :)
12:29 niczero looking at other .ico files, they're "1 icon"
12:29 niczero just wondering if the Mojolicious .ico file is doing something cunning
12:30 nicomen I thought it was two sizes
12:36 niczero yeah, that would be my guess; but why would 'file' only mention 24x24?
12:46 Anon021 joined #mojo
12:46 zivester joined #mojo
12:48 mattastrophe joined #mojo
12:56 niczero Anyone still use apple-touch-icon-precomposed in their headers?
12:58 jberger trone / nicomen / crab : http://pastie.org/10035098
12:58 csson joined #mojo
12:59 deserted niczero, probably a multilayer icon
13:00 crab jberger: what does it produce?
13:00 crab probably not something good
13:00 jberger the value for c is a number
13:01 jberger http://pastie.org/10035106
13:07 jberger I'm not finding a good way to do that pure-perl
13:08 jberger seems B::svref_2object is read only
13:09 ribasushi why would you want that in the first place?
13:09 bramirez joined #mojo
13:09 ribasushi I mean nicomen's question
13:10 jberger ribasushi: see trone's question a little further up
13:11 ribasushi I am still not sure what the question is though...
13:11 ribasushi that is Mojo does recognize IVPVs
13:12 ribasushi (not being contrarian, I really don't get it ;)
13:19 jberger for some reason trone wants the number output of his/her JSON encoding to be represented as a number not as a quoted string
13:20 jberger since Perl JSON encoders have to make heuristic guesses about which format to use, if you want to get a certain output, you have to trick your encoder
13:21 trone jberger: indeed. I thought to +0 all the fields I know are number. In the source of data.
13:21 jberger trone: but that's not enough
13:22 jberger or maybe it is
13:22 jberger :/
13:22 * jberger goes to the source
13:23 jberger ah, I had it backwards
13:23 jberger if the value has ever been used as a number, it will be a number
13:23 jberger https://github.com/kraih/mojo/blob/master/lib/Mojo/JSON.pm#L255-L259
13:23 jberger I guess that makes sense
13:23 jberger so ignore me
13:24 jberger +0 should be sufficient
13:24 jberger trone: ^^
13:27 ribasushi jberger: hence my confusion ;)
13:33 nicomen ;)
13:37 asarch joined #mojo
14:21 marmez left #mojo
14:30 Onigiri So in attempting a ->render(status => 204); it gives a 404 unless I specify some sort of content. Then when I give it some content, even just a json => {}, it returns no content, heh
14:30 Onigiri I'm guessing I putzed something up
14:32 jberger Onigiri: $c->rendered(204)
14:32 jberger render expects content
14:32 jberger rendered tells it you are done
14:32 jberger which is what 204 means, as you know
14:33 Onigiri Yep
14:33 Ptolemarch joined #mojo
14:34 OmarOthman Hi All
14:34 OmarOthman I have a quick question regarding Mojo::IOLoop::ForkCall...
14:34 OmarOthman Does it really fork a new process every time run() is called? Or it uses the underlying built-in preforking web server's workers whenever possible?
14:34 jberger nope, forks every time
14:35 arthas joined #mojo
14:35 jberger why would you want to use a server worker, the whole point is not ot
14:36 OmarOthman I'm asking because I know that fork() is usually an expensive operation... so I was wondering what kind of optimizations this module uses to avoid its overhead...
14:36 alexbyk joined #mojo
14:37 crab a module that's called "ForkCall" is hardly likely to be *avoiding* forking...
14:39 OmarOthman OK. I'm testing using it in a recurring event in the event loop, so that's why I wanted to know more about what performance to expect.
14:39 mattastrophe joined #mojo
14:39 OmarOthman Thanks...
14:39 jberger OmarOthman: you use it when the thing you need to do is going to take a long time
14:39 jberger making fork time negligable
14:40 OmarOthman OK, cool.
14:40 jberger perhaps one of these days I will make a demo the way I use it, with a wrapper and a should_fork method
14:42 crab jberger: please do. i would find that useful.
15:08 jonathan joined #mojo
15:09 OmarOthman joined #mojo
15:14 sh4 joined #mojo
15:17 Ptolemar_ joined #mojo
15:57 sri crab: i mean some proof with actual Mojo::Pg code ;)
15:57 sri something where the cached branch totally destroys master
16:00 crab since when did "totally destroys" become the criterion for acceptability? we've accepted changes for a lot less of a change in the past.
16:00 crab but sure, i'll redo the pgbench benchmark with mojo::pg when i have the time. i think it's a largely waste of time, but fine.
16:01 crab i can't deny that i'm mildly curious about it too (i.e. to see if there's anything in DBD::Pg that is relevant to such things)
16:10 sri there's more questions, like, does it have to be optional, and if it only affects very specific queries (and how realistic those queries are)
16:11 sri the caching branch is still pretty complex https://github.com/kraih/mojo-pg/compare/caching
16:12 sri and with optional prepared statements it would only get more complicated
16:13 crab right. i'll read it.
16:14 sri it would be different with prepare_cached, but that doesn't work
16:14 sri (doesn't pass the tests)
16:18 crab i'll see if i can figure out why that is.
16:18 crab where exactly did you change prepare to prepare_cached?
16:18 sri https://github.com/kraih/mojo-pg/blob/master/lib/Mojo/Pg/Database.pm#L93
16:21 crab thanks
16:25 Ptolemarch joined #mojo
16:39 dod joined #mojo
16:40 cpan_mojo Mojolicious-Plugin-OAuth2 1.51 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-OAuth2-1.51
16:42 batman Lee: ^ enjoy
16:49 dexteruk joined #mojo
16:52 Oleg joined #mojo
16:58 ZadYree hey! I had the bad idea to use Mojo::IOLoop to ping a host as root in my mojolicious app. But even after a ctrl+c, morbo keeps running after i used pkill, kill && killall. Any idea?
17:04 cpan_mojo Mojo-JSON_XS 0.101 by Nic Sandfield - http://metacpan.org/release/NICZERO/Mojo-JSON_XS-0.101
17:07 cpan_mojo Mojo-SMTP-Client 0.04 by Oleg G - http://metacpan.org/release/OLEG/Mojo-SMTP-Client-0.04
17:08 punter joined #mojo
17:11 ZadYree Well, rage-reboot time...
17:11 ZadYree shame on me...
17:12 Oleg ZadYree: How about kill -9 ?
17:12 purl REALLY dirty AND bad-mannered
17:16 ZadYree joined #mojo
17:28 OmarOthman joined #mojo
17:30 sri crab: btw. this was the test i saw failing first with prepare_cached https://github.com/kraih/mojo-pg/blob/master/t/database.t#L40
17:31 sri the reason is not obvious, two of those queries will get the same sth, but there's a waiting list and only one gets executed at a time
17:31 sri "Mojo::Reactor::Poll: Read failed: DBD::Pg::st fetchall_arrayref failed: no statement executing at /Users/sri/repo/mojo-pg/lib/Mojo/Pg/Results.pm line 20..."
17:36 sri aaah
17:36 sri i can see why :)
17:37 sri we perform the query sequential, but the delay synchronizes them, and we end up with two Mojo::Pg::Results objects sharing the same sth
17:37 sri which of course doesn't work
17:37 sri that kills prepare_cached for us
17:38 sri on the plus side, the tests really cover a lot of edge cases
17:39 sri s/the query/the queries/
17:41 zackiv31 joined #mojo
17:42 sri so, to sum it up, prepare_cached is a total no go, and only the complex caching branch would work
17:50 marcusr so tired of scattering use experimental all over my code. wish I could disable those damn warnings globally.
17:55 marty joined #mojo
18:03 irq_ joined #mojo
18:06 irq joined #mojo
18:08 irq_ joined #mojo
18:20 kaare joined #mojo
18:22 sri marcusr: hahaha, i think you voted against Mojo::Base doing it ;p
18:23 * sri remembers bringing up the topic a few months ago
18:36 berov joined #mojo
18:43 marcusr sri pretty sure I voted for it doing it.
18:51 Oleg joined #mojo
18:55 marcusr sri: the only discussion I could find was you and jberger, and there didn't seem to be a vote
18:56 jberger I probably said something along the lines of "we can't seriously enable an experimental feature by default", which is sadly still true
18:57 jberger marcusr: https://metacpan.org/release/Import-Base
18:57 jberger even takes care of things that have to be imported last
18:57 jberger which is intended for exactly this
18:57 jberger preaction++
18:59 sri ah, tempire was even against using signatures in the frontpage example
19:00 sri jberger too
19:01 jberger was I against it in the example?
19:01 sri http://irclog.perlgeek.de/mojo/2014-09-20#i_9388510
19:02 jberger http://irclog.perlgeek.de/mojo/2014-09-20#i_9388644
19:03 jberger note also that I was advocating to immediately bump the perl dep version to the first version where it is non-experimental
19:04 jberger and go all signatures
19:04 sri that would be 5.24 (at best)
19:08 marcusr moving at glacial pace.
19:27 dotandimet joined #mojo
19:35 crab hm. it's been too long since i saw a glacier.
19:35 marcusr me too. Specially given where I live.
19:35 bwf joined #mojo
19:36 marcusr I just need to read p5p to remind me tho. #scnr
19:37 jberger marcusr: isn't there a glacier like down the street and around the corner from your apartment?
19:39 marcusr google maps => 'glaciers near me' didn't return anything interesting.
19:40 jberger then again, google thought you had clear skies last night, so I'm going to assume they are wrong about glaciers too
19:41 jabberwok joined #mojo
19:48 marty_ joined #mojo
19:48 sri crab: this is the kind of benchmark i'm interested in https://gist.github.com/anonymous/eaf7c1b1091eac77c99b
19:48 sri stuff everyone can replicate
19:49 sri old vs new
19:49 sri that's a realistic insert test, because the Mojo::Pg::Database instance is destroyed over and over
19:49 sri that actually happens in apps
19:51 dotandimet joined #mojo
19:55 sri i'm not even trying anymore
19:55 sri https://gist.github.com/anonymous/bc2662b834c8df38dabd
19:55 sri arbitrary select wins too
19:56 crab ok.
20:00 riche joined #mojo
20:01 sri one more thing
20:01 sri the caching branch with pg_server_prepare => 0, is still a tiny bit faster than master in that test
20:02 sri so, creating those sths seems rather expensive
20:03 sri (this is the kind of information i was hoping to get from you)
20:04 crab i'm sorry to be such a disappointment, then.
20:06 sri https://s3.amazonaws.com/lecs-community-secondlife/21810_disappointed-cat-is-disappoint-23393-1252295716-93.jpg
20:08 sri oh, i like this one
20:08 sri http://images.cryhavok.org/d/14606-1/Gravely+Disappointed.jpg
20:09 jabberwok arf
20:09 jberger purl: i am disappoint
20:09 purl ...but jberger is on the core team, but I will leave it up to the others if they want me to pursue this further or https://s-media-cache-ak0.pinimg.com/236x/7f/75/6b/7f756bcb3481db56650768cc5fc0cf50.jpg or Foreman...
20:09 jberger hahaha
20:10 jberger I forgot that you can't make purl respond to I sanely
20:10 neilhwatson joined #mojo
20:10 jberger purl: no, I am https://s-media-cache-ak0.pinimg.com/236x/7f/75/6b/7f756bcb3481db56650768cc5fc0cf50.jpg or Foreman
20:10 purl okay, jberger.
20:10 disputin joined #mojo
20:10 jberger jberger?
20:10 purl you are https://s-media-cache-ak0.pinimg.com/236x/7f/75/6b/7f756bcb3481db56650768cc5fc0cf50.jpg or Foreman
20:11 alexbyk Hi Mojo::People) What is the reason of using eval "" in the Mojo::attr? This is for debugging purposes, right? Because I made a benchmark with the same module without magic an it works 1-5% faster than current impl. So it's nor about the performance
20:11 sri purl: no, jberger is http://i.imgur.com/UPfFmXF.jpg or Foreman
20:11 purl okay, sri.
20:12 irq joined #mojo
20:12 alexbyk Also I found a hard to implement and hard to find mistake. Looks like it exists only because the attr method is complex and nobody noticed it
20:15 alexbyk I mean this part: https://github.com/kraih/mojo/blob/master/lib/Mojo/Base.pm#L53-L77
20:15 sri same with a placeholder in the select https://gist.github.com/anonymous/2acf4dcfff46593a2175
20:17 dotandimet joined #mojo
20:17 sri even at only 1000 runs the difference is just as visible
20:18 riche sri: have I said "thank you" enough for Mojolicious?  Another win in the last few days.
20:18 jberger alexbyk: you are suggesting that injecting unoptimized code-refs is as fast as writing inlined accessors
20:18 sri mst: do you have an example for where pg_server_prepare => 1 is actually harmful?
20:18 alexbyk jberger: yep
20:18 sri (with postgres 9.4)
20:19 sri riche: \o/
20:19 alexbyk jberger: and even 1-8% faster
20:19 jberger riche++ # agreed
20:19 jberger alexbyk: can we see your patch and your benchmark?
20:20 riche i got the go-ahead for my "special project" ... I just hope I can get hipster enough to pull it off :p
20:20 marcusr get hipster or die trying.
20:20 riche marcusr: yikes!
20:20 jberger mojoconf isn't your "special project" :o
20:20 sri riche right now http://weknowmemes.com/wp-content/uploads/2012/10/how-do-you-do-fellow-kids.jpg
20:21 alexbyk jberger: yep: here https://github.com/alexbyk/perl-bench-oo NewMojo - this is rewritten version of Mojo::Base by me... 5.10-5.21.9 - all version were tested
20:21 riche sri: yeah.  exactly.
20:21 sri well... that meme doesn't 100% fit... but i like it and have not used it in quite some time! ;p
20:22 alexbyk jberger: i didn't make a patch yet because I didn't know. Maybe Mojo::Base is using this magic because of some secret reason ... I can assume the only one: output of Carp::confess
20:23 alexbyk That's why I asked for a reason first before making a patch)
20:26 Eke- joined #mojo
20:26 crab alex: can you generate a diff to read please?
20:26 jberger crab: the key point is attr class method
20:26 Grinnz sri, ->json and ->dom in Mojo::Message::Request are basically amazing for all this API bs i'm messing with atm with Mojo::UserAgent
20:27 Grinnz Response, rather
20:28 alexbyk crab: https://github.com/alexbyk/mojo/commit/839c060df6f0c97804e9785c5133ae476e3145f0
20:28 jabberwok i love how the latest updated form_for is shorter and does more/better than before.  good code gets shorter!
20:29 * sri loves removing code
20:29 sri mojolicious has literally been shrinking for years now
20:29 Grinnz > OAuth token returned in JSON document
20:29 Grinnz > API results returned in XML document
20:29 Grinnz thanks, microsoft
20:30 alexbyk *test
20:30 Grinnz also i just had to figure out how to construct an "XML string array", that was fun
20:32 alexbyk So can anybody answer) Is the magic with eval in Mojo::Base::attr is for debugging purposes or this is a secret) Because it at least contains one bug as far as I can see
20:33 basic6_ joined #mojo
20:35 riche offtopic but for those not aware of the FSF conference this weekend, there is live stream: http://libreplanet.org/2015/live/
20:36 jberger riche: have any suggested viewing?
20:36 jberger are you speaking?
20:36 riche jberger: no ... not ... thought I was going to be in AU right now
20:37 riche I generally follow topics relating to fonts and bios
20:37 jberger alexbyk: I believe (thought I wasn't here when it was written) that it was for performance, which your tests for 5.10 show btw
20:37 jberger alexbyk: you see a bug in Mojo::Base? must be a rare usage
20:38 riche jberger: and there is still chance for me to drive up to boston for it, but it's looking unlikely at this point
20:39 riche I will definitely watch the 'Rock your Emacs' session :)
20:41 alexbyk jberger: in 5.10.1 difference is 1% only. so it can be an observational error(not sure did I named it right). yep I see. But if someone are looking at code and doesn't see a bug - it's better to rewrite such code. Yes?
20:43 jabberwok wish i could be up there, i was in MIT HSSP in the early 80s and met the falafel-eating guru himself on our tour of the Computing Center, lispmachine terminals and all... haven't been back there since '88.  i'd like to learn enough about orgmode to present "How Emacs with orgmode can do everything some folks think they need 'smart' 'telephones' for."
20:46 crab alex: this is nice looking code at first glance. what is this bug you mention?
20:47 Grinnz joined #mojo
20:47 crab ("observational error" is correct, btw)
20:48 coolo joined #mojo
20:51 coolo batman: I just saw your talk from mojoconf about assetpack (which I use) - and I learned about plugin:bootstrap3 that I failed to spot on cpan before
20:51 coolo so I would like to use it in my app, but I can't find a way to add other css to the bootstrap asset - I still would like to get THEONE.css to include the bootstrap sources from the plugin
20:51 Grinnz http://ur1.ca/jxn7f -- is there anything here i can do more concisely, to make an XML array of strings?
20:52 Grinnz with Mojo::DOM
20:58 alexbyk crab: I almost missed you question, because my name is alexbyk, when u wrote alex the message isn't highlited.
21:02 alexbyk crab: r u asking about what is a bug in the current implementation?
21:03 sri crab: do you see a reason to ever deactivate an sth cache?
21:04 genio I've just been helping debug PHP Joomla code for an hour and I really feel like I need a shower now.  ewwwwww
21:05 jabberwok could we get a mention in http://mojolicio.us/perldoc/perldebug  that "perl -d myscript.pl daemon" will give you a morbo-compatible environment where you can set breakpoints, even inside Mojo itself?  that's how i am learning what really goes on behind the curtain.
21:08 sri crab: even for silly stuff like "notify foo, 'bar'" it is much faster...
21:08 sri from 16k to 20k
21:09 sri (per second)
21:09 sri just because the sth does not need to created again
21:09 sri the optimized version (with ->dbh->do(...)) can only push it to 27k
21:17 marmez joined #mojo
21:21 alexbyk ok) So looks like nobody cares what's going on in Mojo::Base) I'm not going to make the same mistakes twice and start discussion (as you know I'm not good in discussions So I'll better be quiet) But if someone will have had feelings that something wrong with the current implementation of Mojo::Base - you can always ask a question, or you have a link to the my rewritten version of it for CTRL-C) I have also notice that my version makes o
21:21 alexbyk utput of Carp::confess less informative. But works 1-8% faster and doesn't rare usage bug and a magic with eval "sub{}")))
21:22 kopekru joined #mojo
21:29 sri alexbyk: you're being a jerk right now
21:30 sri alexbyk: it's not that nobody cares about Mojo::Base, it's that nobody can work with you
21:31 sri you've been asked like 3 times now about details for the bug, you deflect with bullshit about people not caring and your implementation being so much better
21:32 alexbyk sri: r u drunk?
21:32 carsten joined #mojo
21:32 alexbyk sri: I was asking because I wasn' sure.
21:33 sri am i drunk? really?
21:35 alexbyk sri: because I suddenly understood. Maybe there are no problem with me at all. I made test, explained a problem clear enough. Jerk. rly?
21:35 sri alexbyk: what test?
21:35 purl i heard test was X or stupid
21:36 sri you're keeping information from us and actually using that as an argument for your proposed change
21:37 sri "But if someone are looking at code and doesn't see a bug - it's better to rewrite such code. Yes?"
21:37 sri that is the very definition of being a jerk
21:37 jberger alexbyk: you started out much better this time, code and evidence
21:38 jberger but we have been waiting for this bug you mention
21:38 jberger and we don't immediately have the time to dig in
21:38 jberger I'm still at $work
21:38 sri you may have noticed that i've intentionally stayed out of it... but then you started attacking everyone with "So looks like nobody cares..."
21:39 jberger sri and crab are looking at pg
21:39 jberger and people have asked questions and been interested
21:39 sri and that's such bullshit, multiple core team members have talked to you and asked for more
21:39 sri now i'm a little bit upset
21:42 alexbyk sri: you can see my messages above where I explained the bug and even showed a diff as crab asked. This is not an explanation? And why were you quiet when I tried to explain and suddenly became so loud when I was going to go home?
21:43 jberger alexbyk: are you saying there IS a bug, or that its hard to SEE bugs?
21:44 jberger if you are saying that there exists a bug in the current implementation Mojo::Base, I haven't understood what it is yet
21:44 alexbyk jberger: yes) I tried start better) But see - the result is the same)
21:45 jberger alexbyk: mojo is much faster development than any other open source project I'm involved with, but this stuff still takes time
21:46 jberger your first message was an hour and a half ago
21:46 alexbyk jberger: ok. I'll repeate my link, a minute
21:46 jberger and its the end of the work day in the eastern part of the us
21:46 sri jberger: he said "Because it at least contains one bug as far as I can see"
21:47 sri i think the question dodging is intentional at this point
21:47 jberger alexbyk: I will also say this, and I think most of the people on this board will agree that I'm a pretty soft touch
21:48 jberger make a comment like "are you drunk" again (or similar) and I'll have my finger on the ban button
21:48 alexbyk sri: yes) After he called me a jerk)
21:48 Eke- joined #mojo
21:48 alexbyk jberger: yes) After he called me a jerk) Ok. I'll better ignore him)
21:49 jberger alexbyk: it may be a fine line, I think you are not a primary english speaker correct?
21:50 jberger he actually said "you are being a jerk" which is a comment on your actions, this is generally seen as better (though still not pleasant) than saying "you are a jerk"
21:50 alexbyk jberger: https://github.com/kraih/mojo/blob/master/lib/Mojo/Base.pm#L53-L77 - here is a link. In the current implementation $@ isn't localized so it's make impossible to rethrow an error and you will get a surprice using so called Guard. As you mentioned - this is a rare usage. It's true
21:50 jberger but yes, lets try to keep personal attacks of any kind down ok?
21:51 * jberger looks
21:51 alexbyk jberger: yes) Maybe I was wrong ))) Actually i don't know what jerk means)
21:51 jberger as adjectives go, its a pretty mild insult
21:51 jberger for example it can be said on children's tv
21:52 alexbyk jberger: oops) I was sure this is about 'jer**ing off'
21:52 jberger hahaha, yeah, same word, very different context
21:52 jberger english is fun like that
21:53 alexbyk jberger: so I'm confused know. I owe an excuse to sri or he to me?
21:53 jberger ok, now with calmer heads, I'm going to look at the code (taking time out of my work day)
21:53 jberger alexbyk: lets call yours a misunderstanding, and sri, though perhaps a little rude, didn't use an attack I would consider offensive, so lets call this one even?
21:53 jberger but please, no personal attacks
21:54 jberger we like to keep this channel inviting
21:55 alexbyk jberger: as I said I sicerely just don't understand why someone can take an offence by looking in the character in the irc client)
21:56 jberger alexbyk: if you don't understand, then just accept as an matter of policy, please don't use personal attacks
21:56 nicomen if it helps, I am a jerk ;-)
21:57 * jberger slaps nicomen with a fish
21:57 alexbyk jberger: I didn't use personal attak this time) sri was the first who wrote me)))
21:57 alexbyk ok:) i'm a jerk too)
21:57 nicomen not jerking off at the moment though
21:57 nicomen will notify you
21:57 jberger ok, there is a line somewhere and nicomen is well past it, thanks for that!
21:58 alexbyk ok) so is my explanation of problem clear? you need to add local $@;
21:58 nicomen alexbyk: do you have a reproducible piece of code that exhibits the bug you are mentioning? something I can run in my terminal?
21:58 jberger alexbyk: I was just going to say what nicomen said
21:59 jberger also, error handling is much better since perl 5.14
22:00 alexbyk nicomen: now, I just know that every eval should ALWAYS be prepended by local $@, but I can write an example because a few days ago I spend an hour to find such mistake in the 3d party module and understand why Guard can't handle an error a correct way
22:00 alexbyk *no
22:01 jberger alexbyk: I believe that that restriction has been lifted since 5.14
22:01 jberger and in practice I can say that certainly there would be use of $@/eval without local all over the mojo code base
22:02 alexbyk there are now restriction. You just can't rethrow an error next level up because eval {} clears it.
22:04 jberger alexbyk: I truly can't think of a case in which an error you would throw during attribute creation would be caught by that eval
22:04 jberger unless you are making dynamic classes in a way that I don't think we intend
22:04 nicomen alexbyk: you need to back up your claims with code snippets, because or else, someone else has to do it, and the chance of you getting your issue looked at decreases
22:05 jberger alexbyk: that said, if there really are speed increases for not using eval'd strings, as your demos point out, I think we are probably interested
22:06 jberger that said, I'm skeptical, because inlining code strings is usually accepted to be faster
22:06 nicomen alexbyk: I'm interested about the local $@ for my own personal code, so if you have an example of when not localizing $@is a problem I would like to see it
22:07 jberger alexbyk: from perldoc -f eval
22:07 jberger "Before Perl 5.14, the assignment to $@ occurred before restoration of localized variables, which means that for your code to run on older versions, a temporary is required if you want to mask some but not all errors"
22:09 alexbyk nicomen: Ok. i'll get a try)
22:10 nicomen http://stackoverflow.com/questions/7598425/what-are-the-common-pitfalls-when-using-perls-eval <-- this has an ok explanation, and discusses what you are saying about clearing the $@ on success
22:10 nicomen but I don't understand why that is a problem
22:10 alexbyk jberger: and how do you think, is this part with eval a candidate to be rewritten) Because if it's true, there will be no eval and no problem at all) If not - I can make a try to demonstrate)
22:12 jberger a performance enhancement is reason enough, if we are convinced, and if, as you say, the loss of debuggablility of pure functions produced by the string eval aren't worth the speed loss
22:12 jberger all of which would need to be considered
22:13 nicomen like: $ perl -we 'eval { die "1"; 1 } or print "died: $@"; eval { eval { die "2"; 1; } or die "re-thrown $@"; } or print "died again: $@";'
22:13 nicomen died: 1 at -e line 1.
22:13 nicomen died again: re-thrown 2 at -e line 1.
22:13 nicomen I don't see why local is a problem?
22:15 alexbyk jberger: ok) So let's wait when my proposal will be considered and may be there will be no need to argue about this eval))) Because looks like I'm not good at conversations)
22:17 alexbyk nicomen: yes) you are right) this is exactly what i'm talking about) wait a minute) I'll go to my PC and try to write an example) Actually I faced it in the real world app, but it will be too big to copypast I'll try to make it simpler
22:19 jberger alexbyk: that would be very helpful, I'd be interested to see that too
22:19 jb360 joined #mojo
22:25 nicomen alexbyk: excellent!
22:25 purl EGG-see-lent!
22:25 alexbyk ok. A minute) Because i'm writing from laptop lying in the bed...
22:26 Zoffix slacker!
22:26 purl slacker is like lazy bum
22:26 noganex joined #mojo
22:28 * jberger farts in purl's general direction
22:33 sri minion benchmarks also seem to suggest an sth cache is always better
22:37 sri committed to master for now https://github.com/kraih/mojo-pg/commit/09e0ba4f6331f6ac3d3b719280fb4ad6b44cac0b
22:39 juikuen joined #mojo
22:40 alexbyk ready) Not so real world looking but at least shows my point)
22:40 sri can't say i'm happy with the code complexity, but the benchmarks speak for themselves
22:44 alexbyk wget -O e.pl https://gist.githubusercontent.com/alexbyk/cda2f73eba5345232234/raw/651bec27216a8a2b6f2014c1a54ae257ec3bb8b9/gistfile1.pl
22:44 alexbyk prove e.pl
22:45 alexbyk https://gist.github.com/alexbyk/cda2f73eba5345232234#file-gistfile1-pl
22:46 alexbyk nicomen: done)
22:46 alexbyk jberger: done)
22:47 nicomen alexbyk: awesome, so
22:47 nicomen the unless you have, will never work right?
22:48 alexbyk nicomen: see a message above) this test should pass) no matter does this example looks like a toy or not)
22:48 nicomen ah sorry, I am not hundred percent sure I understand, maybe you can explain
22:49 nicomen but here is what I'm thinking, so, in perl, if you use eval{}, you always have to keep in mind that code might affect $@
22:49 nicomen right?
22:49 alexbyk nicomen: if you saw my explanation a few days ago you know that explanations - this is something I' need to ommit) We have a person olegWhatAFk - he is good at this)
22:49 nicomen if you saw the link from stackoverflow there is a known problem that code might run between the raised $@ and you checking it
22:50 nicomen which is what you are doing yourself right now by calling a ->last_error method
22:51 alexbyk nicomen: yes) I commented that it may look like a mistake and you can say that there is a mistake in the example, not in Mojo::Base implementation) But you can try to use a link a gave above with patches - with my version or with localized copy this will never happen
22:52 nicomen alexbyk: I agree that if Mojo::Base localises it, this will not happen
22:52 nicomen BUT
22:52 nicomen any other code you run where you are setting the attr(), with any other library
22:53 nicomen or even system calls or builtin keywords add a possibilty of ruining your $@
22:53 nicomen so even if Mojo::Base fixes most real world code written without checking $@ immediately will fail
22:53 alexbyk ok) lets see this example copy) I've written a test. It can pass or not. So the question is - should this test pass or should this test fail))) Computers don't like maybe)
22:54 sri crab: a comment on that commit would be appreciated
22:54 nicomen alexbyk: it should not happen, ever, but it's not possible in perl as it is AFAIK. So pluggins one hole will just confuse users and won't help much in the long run
22:55 nicomen alexbyk: if you get all of CPAN to localize $@ then it would be worthwhile
22:55 alexbyk nicomen: I knew that this will be a subject to discuss) That's why I was not insisting about the bug as a reason but wrote benchmark to show how this can fix)))
22:56 nicomen alexbyk: I have no say in deciding this. But if it doesn't impact performance, I see reason why not though. But it's not really helping, the code you wrote should have been written differently to begin with it _I think_
22:57 alexbyk nicomen: ok) and let's see what happens if we change an implementation to mine. Because current impl. doesn't pass this test, while my passed it. So either my versions contains an error and can't be used or current impl.
22:57 jberger alexbyk: while that is an interesting exercise, as I suspected, it is using a much more dynamic use of attr than we recommend
22:58 nicomen jberger: should it have died accessing a non-declared attribute?
22:58 nicomen or, not accessing, but writing to.
22:58 alexbyk jberger: yes) But I have a test. Current impl. doesn't pass it, mine pass. So either current impl contains a bug or mine) If mine is a buggy one - it's not recemmended for use)
22:59 nicomen alexbyk: your implementation passes your example, try running any other code that uses eval{} internally in the same block and it will fail again ;)
23:00 alexbyk nicomen: it's 00:59 for me))) I can't write today any other line))) I'm already kind of dreaming)
23:01 alexbyk but I believe it's a subject to discuss regardless will Mojo::Base be changed or not)
23:01 jberger alexbyk: your example isn't wrong, but I might argue that the usage of attr in that way is not supported
23:01 nicomen true
23:01 nicomen jberger: isn't that a bit irrelevant really?
23:03 alexbyk jberger: I can argue that every implicid (not sure is this a right word) is a bug))) You can got eihter true, or false) If you got both - this is an heisenbug in the future)
23:03 alexbyk Ok) I'm going to sleep. Good night mojo::People)
23:03 jberger alexbyk: o/
23:04 jberger nicomen: the fix, as seen in the Try::Tiny documentation isn't as easy as you might wish https://metacpan.org/pod/release/DOY/Try-Tiny-0.22/lib/Try/Tiny.pm#Localizing-silently-masks-errors
23:05 jberger because if you localize $@ before the eval, you can't die in that same scope
23:05 jberger which Mojo::Base::attr does
23:05 jberger so there are three options, do nothing (and argue that the usage is unsupported)
23:06 jberger my $err = do { local $@; eval "..."; $@ }; die $err if $err
23:06 jberger which sucks
23:07 nicomen jberger: I would say, wether or not is unsupported is a bit irrelevant as alexbyk is hoping that his $@ will stay untouched when running external code, that's an assumption you in general cannot do
23:07 jberger or move away from the string eval
23:07 jberger which has its own pros (performance? I'm still skeptical) and cons (harder to read stack traces, say for exceptions in default values)
23:07 jberger nicomen: true
23:08 jberger and that's essentially why I argue for the first point
23:08 * sri once again challenges everyone here to come up with cases where Mojo::Pg master got slower than the cpan version
23:08 nicomen it sounds that if you want to fix it "properly" a Mojo::Exception class might be useful (and avoid code cluttering)
23:09 jberger sri: I'm assuming you have just done the simple things like benchmark the test suite?
23:09 jberger or would it just fall in the noise
23:09 jberger probaby
23:09 sri impossible to measure, too little goin on
23:10 jberger I don't have any massive/complex queries lying around
23:10 jberger at least not for postgres
23:10 jberger $work I do, but that's mysql
23:10 sri i've done minion stress tests, they all got faster
23:10 sri inserts by a lot, and selects a little bit
23:11 jberger are there any negative impacts?
23:11 sri none that i know og
23:11 sri s/og/of/
23:11 jberger I mean, insert and select are the heart of any db application IMO
23:12 sri example for the simple benchmarks i did https://gist.github.com/anonymous/bc2662b834c8df38dabd
23:12 sri https://gist.github.com/anonymous/2acf4dcfff46593a2175
23:12 jberger <meta property="og:sri" content="supervillian/robot">
23:14 sri and prepared statements or not doesn't even matter for the gain
23:14 jberger well the numbers seem to be there
23:14 sri $pg->db->query("notify foo, 'bar'") went from 16k/s to 20k/s
23:16 jberger I can't say I have a clear understanding of the proposed change, but it looks to me like you get performance wins
23:16 jberger anyway, dinner time
23:16 jberger bbl
23:16 * marcusr is trying to get cozy with ->%*
23:17 jberger <3 postderef
23:17 jberger and hashy slice
23:17 jberger $boss says that once freebsd ports go to 5.20 we can do so too
23:17 Zoffix \o/
23:17 jberger its kinda nice writing an end-user app, I get to use stuff!
23:23 marcusr sri: I feel like I want to have plugins be EventEmitters. Any advice?
23:23 marcusr less drugs?
23:23 sri minion does it
23:23 sri more like "meh"
23:24 marcusr sri: nice.
23:24 marcusr sri: hacking a bit on https://github.com/marcusramberg/marvin
23:25 marcusr not quite happy on how I "Integrated" Mojolicious::Lite tho :-/
23:26 sri your code always makes my ocd hurt :(
23:26 sri i want to strangle you for this https://github.com/marcusramberg/marvin/blob/master/lib/Marvin/Plugin/Console.pm#L6
23:27 marcusr sri: that was just a quick placeholder. It should be https://github.com/marcusramberg/marvin/blob/master/lib/Marvin/Plugin/RT.pm#L10
23:27 marcusr this is very much a work in progress :)
23:28 marcusr I'm also wondering if I'm using the wrong perltidyrc
23:30 Averna joined #mojo
23:37 marcusr sri: I can't see minion plugin being an event-emitter?
23:49 bpmedley_ joined #mojo

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