Camelia, the Perl 6 bug

IRC log for #mojo, 2013-05-09

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

All times shown according to UTC.

Time Nick Message
00:11 ka2u joined #mojo
00:28 whitebook joined #mojo
00:48 jberger chansen, at the risk of starting a flamewar, if as you say US-ASCII is a subset of UTF-8, and as the web is much bigger than just the us, why shouldn't modern tools do all they can to make handling unicode easy
00:49 jberger s/(us)/uc($1)/e
00:50 jberger recent Perls have great unicode support, but you have to turn it on in order to get it
00:50 jberger because of backward compatibility
00:50 jberger and because we dont have a version number greater than 5 available to us
00:50 * jberger seems to be spoiling for a fight
00:51 jberger (in the polite and friendly manner that #mojo is rightly proud of)
00:59 shmuel joined #mojo
01:05 marty dogpile on jberger
01:07 marty btw, should I be testing 4.0 from the github branch and give feedback?  or should I wait until the official release to bang on it?
01:11 jberger marty: I was going to post a picture of the meme where people jump and make it look like the one person is magically pushing them all away
01:12 jberger but obviously I couldn't remember the name :-)
01:26 ka2u joined #mojo
01:37 good_news_everyone joined #mojo
01:37 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/oixZig
01:37 good_news_everyone mojo/master fa39fde Sebastian Riedel: changed Mojolicious default secret to the application moniker to make it slightly more secure
01:37 good_news_everyone left #mojo
01:40 jberger sri: good idea
01:41 sri \o/
01:49 ka2u joined #mojo
01:57 d4rkie joined #mojo
01:58 Kulag joined #mojo
02:01 heytrav joined #mojo
02:06 Kulag joined #mojo
02:17 heytrav joined #mojo
02:19 zivester joined #mojo
02:23 egopro joined #mojo
02:44 egopro joined #mojo
03:18 zackiv31 joined #mojo
03:19 jb360 joined #mojo
03:41 preflex_ joined #mojo
03:54 fildon__ joined #mojo
04:10 sh3 joined #mojo
04:29 zackiv31 joined #mojo
04:36 zackiv31 joined #mojo
04:50 salparadise joined #mojo
04:52 zackiv31 joined #mojo
04:58 Gedge joined #mojo
05:05 ka2u joined #mojo
05:17 ka2u joined #mojo
05:27 jnbek joined #mojo
05:27 egopro joined #mojo
05:37 abqar joined #mojo
05:41 Vandal joined #mojo
06:37 Mike-PerlRecruiter_ joined #mojo
06:57 egopro joined #mojo
07:01 rihegher joined #mojo
07:15 suy joined #mojo
07:17 rihegher joined #mojo
07:26 rihegher joined #mojo
07:33 egopro joined #mojo
07:34 egopro joined #mojo
07:34 lukep joined #mojo
07:44 inokenty joined #mojo
07:47 mrphilov joined #mojo
07:57 yakudza joined #mojo
08:26 ObseLeTe joined #mojo
08:27 jzawodn joined #mojo
08:52 basiliscos joined #mojo
08:59 rihegher left #mojo
09:04 nelio joined #mojo
09:16 Vandal joined #mojo
09:32 Kulag joined #mojo
09:37 duncanthrax joined #mojo
09:38 shmuel joined #mojo
09:54 Drossel joined #mojo
10:09 mire_ joined #mojo
10:54 KindTwo joined #mojo
10:56 hrupp joined #mojo
11:27 ZadYree https://twitter.com/agixid​/status/332449526055067648
11:35 basiliscos joined #mojo
12:04 D4RK-PH0ENiX joined #mojo
12:14 basiliscos joined #mojo
12:24 bowtie joined #mojo
12:52 rem_lex| joined #mojo
12:55 d4rkie joined #mojo
13:02 bluescreen joined #mojo
13:04 doby joined #mojo
13:07 dpetrov_ joined #mojo
13:35 moltar joined #mojo
13:35 ka2u joined #mojo
13:50 xxtjaxx joined #mojo
13:51 xxtjaxx Hey! Any recomendations on how to handle processes like uploaded files that are processed on upload and should trigger an event in the frontend?
14:02 btyler joined #mojo
14:16 kvorg_ joined #mojo
14:16 kvorg joined #mojo
14:31 basiliscos joined #mojo
14:32 jberger_ xxtjaxx, I was working on a websocket based file-sending protocol named GalileoSend, which comes with Mojolicious sender and receiver as well as a javascript sender
14:33 jberger_ its pretty easy to trigger an event on completion
14:33 jberger_ https://github.com/jberger/GalileoSend
14:33 jberger_ I got a little sidetracked with my education there for a while, but its really near release quality
14:33 jberger_ I think I was waiting on writing a few more docs IIRC
14:34 gryphon joined #mojo
14:37 jberger_ here is a use example: https://github.com/jberger/GalileoSe​nd/blob/master/example/server.pl#L31
14:38 jberger_ where sendfile() is a wrapper which defines the handlers and GalileoSend({...}) is the actual function I provide with the library
14:52 asarch joined #mojo
15:02 basiliscos joined #mojo
15:15 jberger_ oh hmmmm, recent Mojolicious changes have broken GalileoSend
15:15 jberger_ patches coming
15:17 xxtjaxx jberger_: Hi Joel. I was more thinking along having uploaded a file already and have it parsed and processed immediately...
15:18 xxtjaxx eg. my Exported GReader config.
15:19 jberger_ well that shouldn't be too hard
15:19 jberger_ it could use GalileoSend or not
15:22 jberger_ http://mojolicio.us/perldoc/M​ojolicious/Lite#File_uploads
15:23 jberger_ if you use ajax to upload to something like this, the response you send could trigger some finish event in your client
15:40 jberger_ ok, GalileoSend fixed (I know people were waiting with bated breath)
15:40 btyler joined #mojo
15:42 ynonp joined #mojo
15:47 sri jberger_: what broke?
15:47 jberger_ the json pointers in tests and the use of $delay->end
15:48 gtodd joined #mojo
15:48 jberger_ things I was aware of and had fixed in Galileo but forgot about for GalileoSend (which isn't released yet)
15:51 rihegher joined #mojo
15:53 denisboyun joined #mojo
15:53 sri ah
15:54 jberger_ sri: opinion? http://stackoverflow.com/a/16465944/468327
15:54 sri glad we fixed json pointers, the normal form is important for json patch
15:54 jberger_ yeah
15:57 sri jberger_: i use a different technique currently https://github.com/kraih/mojo/blob/m​aster/lib/Mojo/IOLoop/Stream.pm#L59
15:57 sri removing and readding the whole timer can be very expensive
15:58 sri especially when you're using it for i/o timeouts that reset constantly
15:58 sri many times per second is not unusual
15:58 sri it depends on what precision you need
15:58 jberger_ that makes sense
15:59 sri i've considered adding a way to reset timers to Mojo::IOLoop/Mojo::Reactor
15:59 xaka joined #mojo
15:59 sri EV timers can be reset with ->again
16:01 sri main problem is that it gets hard to add new event loop backends, since many don't support resetting timers
16:03 sri (in which case you would have to fall back to expensive remove/readd)
16:05 sri EV semantics are a bit odd too though, you can only ->again recurring timers, not normal ones
16:06 jberger_ updated
16:07 * sri was about to ask if it was polite to answer to an AnyEvent question with a Mojo::IOLoop answer... but then noticed the mojolicious tag :)
16:07 jberger_ and the username :-)
16:08 jberger_ in general that's an interesting question
16:08 sri it is
16:08 jberger_ since I know the interface to Mojo::IOLoop, and since they are interoperable, I would think about doing so for a pure AE question
16:08 * sri is still looking for the most correct answer as well
16:08 jberger_ but I would probably mention that
16:09 jberger_ if you find something better, by all means go ahead and post
16:09 jberger_ I won't accuse you of poaching
16:09 jberger_ I have plenty of rep
16:09 sri sweet sweet karma!
16:09 jberger_ I mostly just use SO to promote my favorite projects now
16:10 jberger_ and yes, to help users (with my favorite projects \m/)
16:10 jberger_ SO is a very important gateway to help new or prospective Perlers
16:11 jberger_ if they don't get good help quickly they might go elsewhere
16:13 btyler or worse, end up looking at a PERL tutorial
16:14 jberger_ yeah, I keep the link to http://perl-tutorial.org/ and http://www.onyxneon.com/bo​oks/modern_perl/index.html handy
16:14 jberger_ links
16:16 ynonp joined #mojo
16:41 gtodd1 joined #mojo
16:51 * sri wonders why EV's ->again kills normal timers and only resets recurring ones
16:55 tempire memowe: You should update Mojolicious::Plugin::Subdispatch
16:55 gtodd joined #mojo
17:01 tempire MOJOCON
17:01 * tempire pokes marcus
17:02 Britzel joined #mojo
17:02 gtodd where will MOJOCON be held ... in Brasil ? :-)
17:08 suy in the Canary Islands, since they do the MOJO piCON # https://en.wikipedia.org/wiki/Mojo_%28sauce%29  and  http://www.food.com/recipe/mojo-pico​n-garlic-sauce-31699?layout=desktop
17:10 sri oh, i forgot something about the stream timeout
17:10 sri it can be changed dynamically, so ->again wouldn't work
17:11 sri recurring timer and low precision are better there
17:17 * sri thinks being able to adjust the inactivity timeout at any time is a valuable feature
17:19 sri we could turn ->timeout into a method though, which hard resets the timer
17:20 * gtodd wonders why String::Util isn't in perl distribution
17:21 gtodd ... maybe because it's easy to create your own (and perhaps speedier) perl functions to do the same thing for each application?
17:21 gtodd or Util.pm makes one lazy
17:22 gtodd wait ... lazy is good
17:22 sri it doesn't look very core worthy to me
17:22 sri not even xs optimized
17:22 gtodd :)
17:23 gtodd true that ... but trim($string) is so addictive :P
17:23 sri that said, trim and friends are core methods in perl6
17:23 sri use Mojo::Util 'trim';
17:23 sri :)
17:24 sri ours is faster
17:24 gtodd yeah so there might be interest in XS-ifying utilities that are similar and in perl6
17:24 gtodd sri: hehe
17:24 gtodd sri: now if mojo was in CORE ... :)
17:24 sri there are more perl6 primitives i love, like slurp/spurt, which are also in Mojo::Util now
17:25 sri core is where modules go to die
17:25 gtodd sri: yeah ... tried to use slurp this morning and forgot I didn't have it :)
17:25 dod joined #mojo
17:26 gtodd sri: it's sort of odd that CGI remained for so long
17:26 sri very odd
17:27 gtodd now that it is going a wrestling contest   could be held to chose a replacement  ...
17:27 sri there should be no replacement
17:27 gtodd or one could rely on stars of CPAN :-)
17:27 gtodd yeah
17:28 gtodd as long as Mojo can run using only core perl :)
17:29 gtodd sri: what are your feelings regarding perl OO?   Moose Mouse Moo blessing exporting etc
17:31 sri use what you need
17:31 sri most of them have their use
17:33 jberger_ Personally I love Mojo::Base until I need BUILD or triggers, then I move to Moo, I only now go to Moose when I need my MooseX::Types::NumUnit module for scientific applications
17:33 gtodd so even though half of CPAN deps on Moose the core approach to OO  in perl5 is not going to morph into Moose-lite ?
17:33 sri i made Mojo::Base when it was still frowned upon to use anything else than Moose
17:34 jberger_ gtodd, Moo is Moose-lite
17:34 jberger_ Moo is what you want generally I would say
17:34 gtodd it seems like perl6 (or pugs) approach to OO inspired newer perl5 OO
17:34 jberger_ Moo is designed to play nicely with Moose
17:34 ynonp joined #mojo
17:35 gtodd jberger right ... Moose with out Stuff Extra
17:35 jberger_ Mojo::Base works acceptably because it is incredibly thin and doesn't attempt to solve hardly any of the problems that Moo/Moose does, but it is darn fast
17:35 gtodd in my mind I can't help read Moo as -MOO :-\
17:35 jberger_ I tried to add a BUILD to Mojo::Base and its slowed it down by more that half!
17:36 jberger_ (that is meant as an evidence of how fast Mojo::Base is)
17:37 sri also helps that mojolicious uses single inheritance exclusively
17:38 gtodd my brain has:  -Mojo ("means -M...ojo")  and by extension -Moo ("is -M..oo")
17:38 * jberger_ is interested to see if people actually start using Roles
17:38 jberger_ (vs multiple inheritance)
17:38 gtodd my brain is small and attempts early optimization  :-\
17:39 sri multiple inheritance is just terrible imo
17:39 * sri learned his lesson from early catalyst :)
17:39 gtodd :)
17:39 sri if you need more than single inheritance just go roles
17:40 jberger_ sri: agreed, but I still haven't seen Roles in the wild very often
17:40 sri what i see quite often though is people go roles way too early just for the sake of it
17:40 jberger_ I tried to use them in my Moodule::Base experiment :-)
17:40 sri things get more interesting in perl6, where you can apply roles to objects at runtime, not just classes :)
17:40 jberger_ (note the Moo in there)
17:41 jberger_ sri: that's cool
17:41 * sri is not sure if crazy cool or crazy evil
17:42 sri perl6 is so dynamic, it makes you wonder if it could ever be fast
17:43 jberger_ per-instance roles make sense
17:43 sri absolutely, those are even good for performance
17:43 denisboyun_ joined #mojo
17:44 jberger_ I always go back the the Teacher who isa Person and then the Mechanic who isa Person, now what do you do when you want the Mechanic to teach?
17:44 sri since those methods get inlined
17:44 jberger_ thats my mental model for roles
17:44 jberger_ if Teacher is a role, then the mechanic can teach too
17:45 sri :)
17:45 gtodd roles rock :)
17:45 jberger_ k I gots to go for a while, talk amounst your-selves, I'll give you a topic: "Rhode Island is neither a road nor an island" discuss
17:46 sri wasn't rhode island a tea?
17:46 gtodd perl6 has roles and slurp and and ... but I'm still excited by perl-5.18 , 5.20 ...
17:48 gtodd there's roosters on rhode island read I ...
17:49 gtodd what's neither a road nor an island but it red all over ;-)
17:49 gtodd ok /me go too
17:49 gtodd cheers
17:49 gtodd left #mojo
17:52 btyler joined #mojo
18:00 sri wow, i just tried a timeout reset approach with EV's ->again... and it is way slower
18:02 suy joined #mojo
18:09 sri oops, of course my first benchmark was flawed ;p
18:13 sri http://pastie.org/7823545 # quick hack
18:13 sri performance seems about equal
18:13 denisboyun_ joined #mojo
18:14 marcus hey
18:15 marcus new ws stuff looks handy.
18:15 marcus ws json stuff even.
18:19 ynonp joined #mojo
18:25 good_news_everyone joined #mojo
18:25 good_news_everyone [mojo] kraih created timers_again (+1 new commit): http://git.io/6hjZxQ
18:25 good_news_everyone mojo/timers_again fe23a7e Sebastian Riedel: added again methods to the reactors
18:25 good_news_everyone left #mojo
18:26 sri this branch needs further profiling
18:26 * sri is not sure yet if $reactor->again($id) is a good or bad idea
18:27 travis-ci joined #mojo
18:27 travis-ci [travis-ci] kraih/mojo#603 (timers_again - fe23a7e : Sebastian Riedel): The build passed.
18:27 travis-ci [travis-ci] Change view : https://github.com/kraih/mojo/commit/fe23a7e49122
18:27 travis-ci [travis-ci] Build details : http://travis-ci.org/kraih/mojo/builds/7029568
18:27 travis-ci left #mojo
18:29 dpetrov_ joined #mojo
18:35 sri hmmmm, master seems slightly faster
18:36 sri ->again has a much higher precision though
18:36 sri and might be useful for applications
18:36 Mike-PerlRecruiter_ joined #mojo
18:38 denisboyun_ joined #mojo
18:57 nelio joined #mojo
18:59 denisboyun_ joined #mojo
19:17 snaakje joined #mojo
19:17 yakudza joined #mojo
19:25 jberger sri: https://github.com/travis-ci/travis-cookbooks​/blob/026c256b802bab46947144bf3a261051818eaa0​f/ci_environment/perlbrew/attributes/multi.rb
19:26 jberger I just remembered seeing miyagawa++ tweet about 5.17 in travis, so I checked, seems legit
19:33 jberger better link, though I think its the same content: https://github.com/travis-ci/travi​s-cookbooks/blob/master/ci_environ​ment/perlbrew/attributes/multi.rb
19:34 sri jberger_: i wouldn't want to run continuously against dev versions though
19:34 sri way too many bugs
19:36 sri at least two 5.17.x releases were completely broken with mojolicious
19:40 jberger isn't that why we would want to test against it?
19:40 jberger maybe not if it that the Perl is broken and will be fixed
19:40 jberger ok, nm
19:40 jberger :-)
19:41 sri as in the perl is broken, yea
19:42 * sri actually even gets annoyed by cpantesters running against dev versions
19:42 sri every now and then i get a mail with a test fail on perl 5.11.x...
19:43 jberger its a different story if the Perl is broken
19:43 jberger ok thats just silly (5.11.x)!
19:44 jberger in general I would want to know if some intentional change in behavior in a future perl breaks something in my module, but not if its something that just wrong with the perl dev version
19:46 sri well, i keep an eye on p5p and test with perlbrew when something interesting comes up
19:46 jberger I try to keep up on p5p but its damn near impossible
19:46 tianon joined #mojo
19:47 sri at least the big changes hit twitter usually, like the hash seed change
19:47 jberger I do like the monthly reports that someone (I forget who) posts, but that means I'm at least a month behind
19:48 sri does it matter? stable perl only gets released once a year
19:49 jberger in the rare case that I would want to voice an opinion on something
19:50 jberger so in the end, not really
19:52 denisboyun_ joined #mojo
20:02 mrphilov joined #mojo
20:17 * yko does archeology stuff: git checkout v1.98 && prove -lr
20:28 sri CAN HAZ OPIONIONZ ON ->again?
20:30 jberger seems useful, its right on the far-reaches of my knowledge so I don't feel able to comment
20:30 jberger but if it makes things faster and easier to write then I'm for it
20:31 sri i'm unsure if it makes anything faster
20:31 sri benchmarks are inconclusive
20:31 jberger well as long as its not slower, and if its easier to write this common use-case, then its still a net win right?
20:31 sri it may scale better with many many connections
20:32 sri (thousands)
20:32 sri biggest gain i suppose is in precision, together with making things *not* slower
20:33 sri the recurring trick from earlier had the disadvantage that precision was only 1s, anything below would cost performance
20:34 jberger ah, I see
20:34 sri for our core use case precision is not as important though... making it not a clear gain
20:35 denisboyun joined #mojo
20:35 rihegher left #mojo
20:35 jberger personally I would see the code clarity as more interesting than the precision or performance
20:36 jberger I can see myself wanting this kind of a timeout/reset behavior and needing to jump through these hoops
20:36 jberger 🎩
20:41 mrphilov1 joined #mojo
20:47 sri in a super micro benchmark, it appears to be slightly slower... in the 0.0x% range
20:53 wingfold joined #mojo
21:02 good_news_everyone joined #mojo
21:02 good_news_everyone [mojo] kraih pushed 1 new commit to timers_again: http://git.io/4z_PWg
21:02 good_news_everyone mojo/timers_again ff28702 Sebastian Riedel: small optimizations
21:02 good_news_everyone left #mojo
21:03 sri hmm, could be closer to 0.5-1% slower
21:05 two_tired joined #mojo
21:10 mire_ joined #mojo
21:30 denisboyun joined #mojo
21:32 lukep joined #mojo
21:39 sri oh fun, i have a single file c10k websocket test that works on my little macbook :)
21:39 sri both, daemon and useragent managing 10k connections each
21:40 sri memory usage was 636mb
21:42 sri key to making it work is LIBEV_FLAGS=8
21:42 sri for kqueue
21:43 sri cpu usage at 22% on one core
21:43 sri gonna track down what uses cpu now :)
21:47 sri oh shit
21:47 sri just what i expected, it was the stream timers :D
21:47 sri the timers_again branch sits comfortably at 0% cpu
21:48 sri kind of a big win there
21:50 sri sooooo
21:51 sri to sum it up, the 1s recurring timer timeout is a little better (1%) for pumping steady I/O, while ->again() is *huge* for many many idle connections
21:52 sri and c10k is no big deal at all even for the little daemon
21:54 jberger_ \o/
21:55 * jberger_ high-fives sri, before he realizes that no one does that anymore
21:55 sri o/
21:56 jberger_ \o
21:56 * jberger_ high-fives the guy on StackOverflow who has no idea what a stir he caused
21:57 sri with a few tricks i can get memory usage below 500mb
21:57 jberger_ so I'm assuming you're keeping ->again() then?
21:57 sri i suppose so
21:57 sri i care more about c10k than super micro rps benchmarks
21:57 jberger_ I would give up 1% at low load for a massive boost at high load
21:58 sri that's not quite it
21:58 jberger_ re c10k vs rps: sounds like a blog post to me
21:59 jberger_ especially with all the hubbub about that recent comparison going around
21:59 sri 1% at high load with low consurrency vs massive boost for low load with massive concurrency
22:00 jberger_ still sounds like a win, but you might spin it the other way too
22:00 sri the second case matters quite a bit though
22:00 sri websocket connections are mostly idle, but open for a long time
22:00 sri even behind nginx, you still have the 10k open idle connections
22:01 sri so when that burns through 23% cpu at all times, that costs
22:02 sri with ->again() you wouldn't notice the 10k connections at all (besides memory usage going up a little)
22:02 jberger_ that's really awesome
22:02 jberger_ curious, how high can you push it?
22:02 jberger_ c100k?
22:02 jberger_ what's the new limiting factor now?
22:02 sri memory i suppose
22:03 sri this is only a macbook air :)
22:03 jberger_ and you are holding both sides of the websocket, so its already more like c20k
22:03 btyler http://blog.caustik.com/2012/08/19/​node-js-w1m-concurrent-connections/ # suppose you guys have seen that
22:03 sri yes, the event loop is managing 20k sockets
22:04 sri btyler: yes
22:04 sri but that's an interesting point
22:04 sri i believe at some point the old timer code would kill the server
22:05 sri while timers_again is only limited by memory
22:06 sri (1s timers would keep adding up, using more and more cpu)
22:07 * jberger_ wishes he didn't have to go, this is rather fun
22:07 * jberger_ has to go help $wife with $project
22:08 * jberger_ doesn't really like the symbolism of $wife being a variable
22:08 jberger_ use constant wife => $wife
22:08 jberger_ ok
22:08 jberger_ cheers
22:08 jberger_ o/
22:08 sri haha
22:08 sri \o
22:20 ka2u joined #mojo
22:31 good_news_everyone joined #mojo
22:31 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Mcu6YA
22:31 good_news_everyone mojo/master eb0cd7d Sebastian Riedel: a few more small optimizations
22:31 good_news_everyone left #mojo
22:32 sri and merged :)
22:36 * sri wonders if he should release his little c10k test script
22:39 tagg_ joined #mojo
23:09 sri https://gist.github.com/kraih/5551292
23:12 preaction i'd say "yes" along with some results if you have any
23:12 sri what results?
23:13 sri this is not an rps benchmark
23:20 sri suppose i can mention memory and cpu usage
23:24 tempire joined #mojo
23:28 sri ok, last version should include just about all information i have
23:38 jb360 joined #mojo
23:47 asarch joined #mojo
23:49 mire joined #mojo

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