greptilian logo

IRC log for #virtualJUG, 2015-02-17

virtualjug.com

| Channels | #virtualJUG index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
06:15 edburns joined #virtualJUG
07:16 Bevin joined #virtualJUG
07:27 ewer joined #virtualJUG
07:33 aaspnas joined #virtualJUG
08:00 mmatloka` joined #virtualJUG
08:05 michel_slm joined #virtualJUG
08:08 slaskawi joined #virtualJUG
09:08 edburns joined #virtualJUG
09:16 Tushar joined #virtualJUG
09:16 Tushar Hi All
10:03 feldoh joined #virtualJUG
10:48 pfrobinson joined #virtualJUG
11:06 feldoh joined #virtualJUG
11:37 Bevin_ joined #virtualJUG
11:45 Bevin joined #virtualJUG
11:54 Bevin joined #virtualJUG
12:05 Bevin joined #virtualJUG
12:11 Bevin_ joined #virtualJUG
12:23 feldoh joined #virtualJUG
13:04 aaspnas joined #virtualJUG
13:16 feldoh joined #virtualJUG
13:47 abc123 joined #virtualJUG
13:55 alxs joined #virtualJUG
14:40 feldoh joined #virtualJUG
14:44 pjrgracio joined #virtualJUG
14:47 feldoh joined #virtualJUG
14:53 INeedMySpace joined #virtualJUG
14:54 pfrobinson joined #virtualJUG
15:21 pfrobinson joined #virtualJUG
15:30 pivotal-beaverto joined #virtualJUG
16:22 Rock joined #virtualJUG
16:26 Kira joined #virtualJUG
16:29 feldoh joined #virtualJUG
16:31 feldoh joined #virtualJUG
16:34 feldoh joined #virtualJUG
16:57 sjmaple hey
16:57 sjmaple just as a reminder session starts in 1hr
16:57 sjmaple it's an hour later than usual this week
17:01 aaaaaaaaa111 joined #virtualJUG
17:03 michael_b joined #virtualJUG
17:05 carljokl joined #virtualJUG
17:06 shelajev joined #virtualJUG
17:07 shelajev hello people!
17:08 alxs|away hey
17:08 Tham joined #virtualJUG
17:10 RED2 joined #virtualJUG
17:13 Clemens joined #virtualJUG
17:15 xhac joined #virtualJUG
17:28 mikeb joined #virtualJUG
17:29 mikeb Hi Guys, sorry I'm early :-)
17:33 pathfinder joined #virtualJUG
17:33 Clemens joined #virtualJUG
17:36 mrkinds joined #virtualJUG
17:37 mrkinds left #virtualJUG
17:37 Noordsestern joined #virtualJUG
17:38 Sachin joined #virtualJUG
17:39 sjmaple habit? :)
17:41 pathfinder joined #virtualJUG
17:44 aac joined #virtualJUG
17:45 aaspnas joined #virtualJUG
17:49 nabilov joined #virtualJUG
17:51 tdias joined #virtualJUG
17:51 javajon joined #virtualJUG
17:53 abc123 joined #virtualJUG
17:54 abc123 left #virtualJUG
17:54 jk81 joined #virtualJUG
17:54 rorr joined #virtualJUG
17:55 carljokl joined #virtualJUG
17:55 tocsa_CCJUG_NJUG joined #virtualJUG
17:57 enrevanche joined #virtualJUG
17:57 ahp joined #virtualJUG
17:57 mselender joined #virtualJUG
17:57 millrossjez joined #virtualJUG
17:57 mjremijan joined #virtualJUG
17:58 pivotal-beaverto joined #virtualJUG
17:58 aztec_ joined #virtualJUG
17:58 nickolay joined #virtualJUG
17:58 xhac joined #virtualJUG
17:59 mrkinds joined #virtualJUG
17:59 ecabrerar joined #virtualJUG
17:59 sjmaple just with heinz and Oleg now, starting v soon :)
18:00 Kev joined #virtualJUG
18:00 bigger joined #virtualJUG
18:00 NrgXnat joined #virtualJUG
18:01 millrossjez all set for reflection-related lunacy
18:02 bashnesnos joined #virtualJUG
18:02 nithin joined #virtualJUG
18:02 sjmaple :D
18:02 Omkar_India joined #virtualJUG
18:02 MichalZmuda joined #virtualJUG
18:02 enrevanche joined #virtualJUG
18:02 MichalZmuda left #virtualJUG
18:02 shelajev and it's live
18:02 sanj joined #virtualJUG
18:02 shelajev can you please refresh vjug page
18:02 shelajev if the video didn't start yet
18:03 forest joined #virtualJUG
18:03 RockNY1 joined #virtualJUG
18:03 mrkinds joined #virtualJUG
18:03 bashnesnos joined #virtualJUG
18:03 javajon (clap, clap)
18:04 pm771 joined #virtualJUG
18:04 cafrjbr joined #virtualJUG
18:04 bigjug joined #virtualJUG
18:05 theshade joined #virtualJUG
18:05 michael_b joined #virtualJUG
18:06 shahin joined #virtualJUG
18:06 shelajev oh, this is going to be embarassing! :)
18:07 unfortunate_inte joined #virtualJUG
18:08 bmo77 joined #virtualJUG
18:08 Dentharg joined #virtualJUG
18:09 nazar joined #virtualJUG
18:09 michael_b what happened the third time?
18:09 tocsa_CCJUG_NJUG Continuous Improvement / Integration :)
18:10 Dominik joined #virtualJUG
18:10 Dominik DominikD
18:10 Dominik oops
18:10 pivotal-beaverto joined #virtualJUG
18:10 Ayst joined #virtualJUG
18:11 sjmaple http://www.javaspecialists.eu/
18:11 shelajev third time I jumped better, legs first :D
18:11 Guest64837 left #virtualJUG
18:13 sjmaple which is why he walks like he does
18:16 joshuaw "Streaming is going to lead to Screaming"
18:16 k9 joined #virtualJUG
18:16 shelajev that's a nice trick, I always get lost in those parentheses
18:17 shelajev by the way, does stream.peek() help debugging or is it more or less useless?
18:17 aaspnas joined #virtualJUG
18:21 mselender joined #virtualJUG
18:21 Philippe joined #virtualJUG
18:25 sfdgsdgsdgsgsgs joined #virtualJUG
18:26 pfrobinson_ joined #virtualJUG
18:27 enrevanche call name.toString
18:27 carljokl or any non static member...
18:27 TheShade joined #virtualJUG
18:27 enrevanche this.name = name.toString()
18:29 TheShade somebody's benchmarking here...
18:30 shelajev TheShade! :) welcome to the vjug
18:30 TheShade Yup
18:30 carljokl ....Java Rockstar...
18:30 TheShade Oh, now we will see how great getClass() is... :D
18:33 tocsa_CCJUG_NJUG Why is that much speed difference?
18:33 pfrobinson joined #virtualJUG
18:33 Greg22 joined #virtualJUG
18:34 sjmaple https://twitter.com/shipilev/status/562664253065539586
18:35 sjmaple one of yours, TheShade? :)
18:35 TheShade Oh. So the intrinsic for getClass() that throws exception uses the exception cached by the VM, I would guess
18:35 TheShade It is a bad idea, indeed.
18:38 TheShade Yes, John Rose's favorite non-trick: using getClass for null-checks
18:39 sjmaple so, why such a bad idea?
18:39 RDarrylR joined #virtualJUG
18:39 shelajev is anyone lost now with this jump to methodhandles? good we're back on the reflection track
18:39 TheShade because it says in that NullChecks.java
18:39 TheShade TL;DR: Fear not, my little friends, use Objects.requireNonNull.
18:39 TheShade Stop using these obfuscating Object.getClass() checks,
18:39 TheShade those rely on non-related intrinsic performance, potentially
18:39 TheShade not available everywhere.
18:40 TheShade The usual case of *not* throwing the exception is not actually faster
18:40 TheShade and the way compiler makes stackless NPEs for getClass() is weird at best, and probably a usability bug that should be fixed
18:42 Guest2283 joined #virtualJUG
18:43 TheShade ah, ok, it would seem -XX:-OmitStackTraceInFastThrow will do the stack traces even in getClass() case...
18:44 TheShade here: http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/0499e4a89c76/src/share/vm/opto/graphKit.cpp#l550
18:45 Guest30627 joined #virtualJUG
18:45 nann joined #virtualJUG
18:46 TheShadeX joined #virtualJUG
18:46 forest001 joined #virtualJUG
18:46 sk joined #virtualJUG
18:46 nmax joined #virtualJUG
18:46 hello joined #virtualJUG
18:46 Heinz joined #virtualJUG
18:46 hello helloworldpython
18:46 swati joined #virtualJUG
18:46 mbitard joined #virtualJUG
18:46 Heinz hello everyone
18:46 TheShade Here you are, Heinz
18:47 sjmaple 18:39 <TheShade> because it says in that NullChecks.java
18:47 sjmaple 18:39 <TheShade>  TL;DR: Fear not, my little friends, use Objects.requireNonNull.
18:47 sjmaple 18:39 <TheShade>  Stop using these obfuscating Object.getClass() checks,
18:47 sjmaple 18:39 <TheShade>  those rely on non-related intrinsic performance, potentially
18:47 sjmaple 18:39 <TheShade>  not available everywhere.
18:47 sjmaple 18:40 ⇐ Guest2283 quit (b210a31e@gateway/web/cgi-irc/kiwiirc.com/ip.178.16.163.30) Quit: http://www.kiwiirc.com/ - A hand crafted IRC client
18:47 sjmaple 18:40 <TheShade> The usual case of *not* throwing the exception is not actually faster
18:47 sjmaple 18:41 <TheShade> and the way compiler makes stackless NPEs for getClass() is weird at best, and probably a usability bug that should be fixed
18:47 sjmaple 18:41  → Guest2283 joined  ⇐ Guest30627, Noordsestern and NrgXnat quit
18:47 sjmaple 18:43 <TheShade> ah, ok, it would seem -XX:-OmitStackTraceInFastThrow will do the stack traces even in getClass() case...
18:47 sjmaple 18:44 <TheShade> here: http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/0499e4a89c76/src/share/vm/opto/graphKit.cpp#l550
18:47 j_factor joined #virtualJUG
18:47 ad_ joined #virtualJUG
18:48 sk joined #virtualJUG
18:48 TheShade Yes, nothing is contradictory, just do not use the getClass() :D
18:49 TheShade The comment there in the graphKit seems to imply that many of those compiler-generated exceptions are not visible to the users, and so you are just lucky with those stackless NPEs :)
18:50 reader joined #virtualJUG
18:52 carljokl 0.o
18:52 TheShade Look at the code that Heinz just wrote, and understand what would your getClass() trick look like for future devs :D
18:54 VladimirSitnikov joined #virtualJUG
18:55 mikeb Heinz is muted
18:55 TheShade YES
18:55 joshuaw mikeb: refresh your browser
18:56 Heinz can you hear me?
18:56 joshuaw yes
18:56 TheShade yes, we can hear you
18:56 pm771 OK
18:56 joshuaw I can hear you
18:56 pm771 sound and claer
18:56 mikeb OK now thanks.
18:56 joshuaw sometimes the connection needs a refresh
18:56 alxs Sitting on the outside here, I can tell there is quite some lag
18:57 MikeK joined #virtualJUG
18:57 sjmaple usually there's around a 30-40 second lag
18:57 alxs Sounds about right, y
18:57 TheShade so the video is 30 seconds behind?
18:58 radu joined #virtualJUG
18:58 joshuaw yes TheShade
18:58 alxs Coming straight to us from the future!
18:58 TheShade bummer
18:58 arzu joined #virtualJUG
18:58 sjmaple the stream (audo and video) is 30 seconds behind the G+ recording
18:58 millross_ joined #virtualJUG
18:58 pm771 Is all this code going to be posted somewhere later?
18:59 sjmaple we can ask :)
18:59 radup joined #virtualJUG
18:59 sjmaple probably on github somewhere already
18:59 Guest183123 joined #virtualJUG
19:00 radup joined #virtualJUG
19:01 TheShade I think video and audio are desynced now?
19:01 sjmaple very slightly, not much
19:01 millross_ joined #virtualJUG
19:02 sjmaple <1s
19:03 alxs Milage may vary actually based on my experience... G+ also splitbrains every now and then et al... Distributed system fun
19:03 alxs Now G+ live may well be an entirely different beastactually
19:03 alxs s/beastactually/beast actually
19:04 sjmaple I think we might reconsider our alternatives soon to see whether we can do better
19:04 * alxs experiences a very nice broadcast actually
19:04 sjmaple ok, cool - thanks for feedback
19:05 TheShade I wonder if there is something like Coursera-like marker-over-slides broadcaster. Should be useful for my talks...
19:06 joshuaw sjmaple: https://support.mozilla.org/en-US/kb/firefox-hello-video-and-voice-conversations-online
19:06 Vivek joined #virtualJUG
19:07 Dentharg joined #virtualJUG
19:12 TheShade Oh, I see my share of bad ideas every day, thanks Heinz :)
19:13 sjmaple any questions for Heinz, pls ask now
19:13 Christian joined #virtualJUG
19:13 TheShade This IRC thing is rather distracting for the speaker, I see...
19:13 Christian Is it possible to replace method bodies with reflection somehow?
19:13 alxs Someone asked about the code being available?
19:13 carljokl I imagine in practice though that people calling new instance would know about the classes they are instantiating
19:15 sjmaple thanks Christian, alxs :)
19:15 TheShade Reflection is about *introspection*, not modification. :)
19:15 joshuaw http://www.javaspecialists.eu/
19:15 alxs Wasn't my question ... But, np ;)
19:16 sjmaple :D
19:16 unfortunate_inte can you call a private constructor with reflection?
19:17 shelajev you can make is accessible maybe
19:17 Dentharg I've seen so mind bending tricks here.. Java will never be the same again :)
19:17 ad_ yes you can with setAccessible(true)
19:17 sjmaple haha @Dentharg
19:18 TheShade The popular question that everyone is asking: "How would I find all the classes in the given package with reflection?"
19:19 joshuaw did anyone catch the use of 10_000_000 early on? I did not know about that. http://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html
19:19 TheShade yes, available since JDK 7
19:19 joshuaw yup
19:19 sjmaple Yeh, that was part of project coin
19:20 sjmaple a nice addition
19:21 TheShade now you have to de-learn doing 1024_1024 ;)
19:22 carljokl Don't do this at home....or work...
19:23 swati joined #virtualJUG
19:24 pfrobinson joined #virtualJUG
19:24 sjmaple make sure you have a Java Champion present when attempting this at home
19:24 Guest41353 joined #virtualJUG
19:26 swati joined #virtualJUG
19:26 millrossjez joined #virtualJUG
19:27 sjmaple TheShade: do you know the best way?
19:27 sjmaple :)
19:28 TheShade that's a tricky question
19:28 carljokl I think it is down to the way ClassLoaders are not set in stone
19:28 carljokl The class definition might not be on the file system
19:29 carljokl The ways I have seen around that has involved hacks looking at .class files on the file system and figuring the names out from that but it isn't clean or robust
19:29 sjmaple any final questions
19:30 carljokl May not be possible to know what classes are in a package
19:30 srncristea joined #virtualJUG
19:30 TheShade Noooooooooooooooooo
19:30 * TheShade shudders
19:31 arkander joined #virtualJUG
19:31 TheShade I think it's better to intercept the classloading with Instrumentation
19:31 shelajev yeah, didn't think of that :)
19:31 shelajev when you have a hammer...
19:31 carljokl Reflect before using reflection
19:31 reader thanks very much for all this :)
19:31 swati joined #virtualJUG
19:32 TheShade The next step from reflection is methodhandled. That's some heroin stuff.
19:32 TheShade *methodhandles
19:34 TheShade volatile is unnecessary here; plain field store works
19:35 tocsa_CCJUG_NJUG I haven't seen underscore in integer constants before
19:36 joshuaw tocsa_CCJUG_NJUG: http://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html
19:36 tocsa_CCJUG_NJUG I see http://kodejava.org/how-to-use-underscore-in-numeric-literals/
19:36 tocsa_CCJUG_NJUG JDK 7
19:36 joshuaw yup
19:36 TheShade While you are at it, you can also run with -Xint!
19:38 VladimirSitnikov Another question: "should I cache java.lang.reflect stuff manually"?
19:38 TheShade SoftReferences are great idea, if the alternative is OOME. Trying to get makeshift LRU caching with SoftReference -- that's dumb!
19:40 TheShade If you need to cache any j.l.reflect data, then it should probably be done in JDK itself
19:40 VladimirSitnikov Field.getAnnotation will be dog slow unless you cache Field
19:40 VladimirSitnikov JDK can NOT cache Field since Field is _mutable_ :(
19:40 TheShade I thought Peter Levart et al. cached annotations
19:40 reader just in time for the football I've got 10_000 on Paris  thanks again :)
19:40 VladimirSitnikov as well as mutable is AccessibleObject
19:40 TheShade Field is mutable how?
19:41 VladimirSitnikov AccessibleObject
19:41 VladimirSitnikov setAccessible(true/false) stuf
19:41 VladimirSitnikov f
19:41 swati joined #virtualJUG
19:41 TheShade Ah...
19:41 javajon Thank you!
19:41 MikeK left #virtualJUG
19:42 nithin thanks for the interesting session
19:42 sjmaple thanks for joining everyone!
19:42 TheShade So, you can drop the Field caches when anyone does setAccessible
19:42 sjmaple and thanks to Heinz for the session!
19:43 TheShade (I think)
19:43 jk81 left #virtualJUG
19:44 nithin left #virtualJUG
19:45 VladimirSitnikov I think the cache itself can be kept out of a Field object
19:45 TheShade Wait, I don't get it. Why can't we return the canonical instance of Field?
19:45 VladimirSitnikov we can't because different consumers might invoke setAccessible at their wish
19:46 VladimirSitnikov the first one to call (true) will break "the instance" for others
19:47 TheShade I wonder if Javadoc for AccessibleObject actually says the setAccessible affects "the reflected object" (as in, the actual field) globally
19:47 millrossjez joined #virtualJUG
19:49 TheShade No, it seems to mean the flag is treated in per-AccessibleObject fashion
19:49 VladimirSitnikov " flag a reflected object "
19:50 TheShade I think the "reflected object" means the actual field here
19:50 TheShade but anyhow, the AO.setAccessible explicitly mentions the flag for the AO itself
19:51 TheShade therefore, yeah, we can't cache AOs
19:52 VladimirSitnikov so it would be nice if declaredAnnotations could be reused
19:52 jugfullofjava joined #virtualJUG
19:53 TheShade they are reused for the Class itself, I think
19:53 millrossjez joined #virtualJUG
19:53 TheShade but wait, there is a cache in j.l.Field already
19:54 TheShade what's "dog slow" about it?
19:55 TheShade e.g. http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/87c95759b92b/src/share/classes/java/lang/reflect/Field.java#l1142
19:55 VladimirSitnikov this is per Field cache
19:56 VladimirSitnikov ah!
19:56 VladimirSitnikov 8
19:56 VladimirSitnikov I am still stuck with JRE7
19:57 TheShade in jdk9, it's a DCL-like construct: http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/044de779404d/src/java.base/share/classes/java/lang/reflect/Field.java#l1142
19:57 TheShade well... good luck with that :)
19:57 swati joined #virtualJUG
19:59 swati joined #virtualJUG
20:02 millrossjez joined #virtualJUG
20:02 swati joined #virtualJUG
20:05 TheShade All right, JMM Pragmatics is going to be fun
20:06 TheShade The only thing I have to do is *close* IRC during the talk :]
20:06 mmatloka joined #virtualJUG
20:09 swati joined #virtualJUG
20:11 swati joined #virtualJUG
20:13 swati joined #virtualJUG
20:14 swati joined #virtualJUG
20:16 swati joined #virtualJUG
20:20 swati joined #virtualJUG
20:20 shelajev TheShade, we'll monitor irc for you to forward all the best bits in the form of questions :)
20:22 shelajev thanks to everyone!
20:22 shelajev thanks to Heinz for the great session
20:22 swati joined #virtualJUG
20:22 shelajev I had lots of fun
20:25 TheShade all right, till next time
20:25 * TheShade is still waiting for the announcement
20:31 swati joined #virtualJUG
20:37 shelajev dp you know the date yet?
20:39 swati joined #virtualJUG
20:42 swati joined #virtualJUG
20:44 swati joined #virtualJUG
20:46 mselender joined #virtualJUG
20:50 edburns joined #virtualJUG
20:50 swati joined #virtualJUG
20:54 swati joined #virtualJUG
20:55 mselender joined #virtualJUG
20:56 feldoh joined #virtualJUG
20:57 feldoh joined #virtualJUG
20:59 mselender joined #virtualJUG
20:59 shelajev joined #virtualJUG
21:07 slaskawi joined #virtualJUG
21:20 shelajev joined #virtualJUG
21:26 millrossjez joined #virtualJUG
21:36 Vijay joined #virtualJUG
21:36 edburns joined #virtualJUG
21:36 feldoh joined #virtualJUG
21:45 millrossjez joined #virtualJUG
21:49 mikeb joined #virtualJUG
21:51 mikeb joined #virtualJUG
21:59 millrossjez joined #virtualJUG
22:41 millrossjez joined #virtualJUG
23:27 alxs joined #virtualJUG

| Channels | #virtualJUG index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

virtualjug.com