Re: Stream.fromForEach(Consumer>)

2022-05-23 Thread Steven Schlansker
> On May 23, 2022, at 5:53 AM, Brian Goetz wrote: > > This is a nice use of `mapMulti` to create a stream whose contents are > dynamically generated. It is one step short of generators (which we hope > Loom will eventually give us), in that it is restricted to a generator method > that

Re: fast way to infer caller

2022-04-06 Thread Steven Schlansker
> On Apr 6, 2022, at 3:54 PM, Remi Forax wrote: > > - Original Message - >> From: "Ceki Gülcü" >> To: "core-libs-dev" >> Sent: Wednesday, April 6, 2022 11:26:39 PM >> Subject: Re: fast way to infer caller > >> Hi Rémi, >> > > Now, i don't think there is a real solution to you

Re: LambdaMetafactory requires full privilege access, but doesn't seem to actually restrict functionality

2022-01-18 Thread Steven Schlansker
ferent: your approach will copy from one Java object to another Java object, but what we are doing is reacting to a token stream and trying to bind it to Java objects with as little overhead as possible. > > > On 1/12/22 9:56 PM, Steven Schlansker wrote: >> Hi core-libs-dev, >>

Re: LambdaMetafactory requires full privilege access, but doesn't seem to actually restrict functionality

2022-01-18 Thread Steven Schlansker
> On Jan 13, 2022, at 7:05 AM, Remi Forax wrote: > > - Original Message - >> From: "Steven Schlansker" >> To: "core-libs-dev" >> Sent: Wednesday, January 12, 2022 9:56:30 PM >> Subject: LambdaMetafactory requires full privil

LambdaMetafactory requires full privilege access, but doesn't seem to actually restrict functionality

2022-01-12 Thread Steven Schlansker
eedback on the overall approach of using the Metafactory, perhaps I am way off in the weeds, and should just trust MethodHandles to perform well if you use invokeExact :) JMH does seem to show some benefit though especially with Graal compiler. Thanks a bunch for any thoughts, Steven Schlansker

Future.get(Duration)?

2018-04-09 Thread Steven Schlansker
Hi core-libs-dev, Future.get(int, TimeUnit) is great, it allows you to put a timeout. Duration is great, it's a common way to cart a duration around, and some frameworks can parse it for you, say you have an injector (Spring in this case) that can handle: @Value("my-timeout:PT10s") Duration

Re: Adding SocketChannel toString to connection exception messages

2018-01-02 Thread Steven Schlansker
th cloud providers, you may not understand the space of IPs that an Abstract Cloud Device like ELB might come from -- it's coming from an AWS pool that you have no visibility into. > On Jan 2, 2018, at 8:35 AM, Alan Bateman <alan.bate...@oracle.com> wrote: > > On 29/12/2017 00

Re: Adding SocketChannel toString to connection exception messages

2017-12-28 Thread Steven Schlansker
> > Gruss > Bernd > -- > http://bernd.eckenfels.net > > From: net-dev <net-dev-boun...@openjdk.java.net> on behalf of Chris Hegarty > <chris.hega...@oracle.com> > Sent: Friday, December 22, 2017 4:17:31 PM > To: Seán Coffey; David

Re: Adding SocketChannel toString to connection exception messages

2017-12-21 Thread Steven Schlansker
> On Dec 21, 2017, at 4:35 PM, David Holmes <david.hol...@oracle.com> wrote: > > On 22/12/2017 10:29 AM, Steven Schlansker wrote: >>> On Dec 21, 2017, at 11:11 AM, Steven Schlansker >>> <stevenschlans...@gmail.com> wrote: >>> >>> What

Re: Adding SocketChannel toString to connection exception messages

2017-12-21 Thread Steven Schlansker
> On Dec 21, 2017, at 11:11 AM, Steven Schlansker <stevenschlans...@gmail.com> > wrote: > > What if ConnectException included the attempted hostname / IP / port > SocketAddress? > java.net.ConnectException: Connection to 'foo.mycorp.com[10.x.x.x]:12345' >

Adding SocketChannel toString to connection exception messages

2017-12-21 Thread Steven Schlansker
Hi core-libs-dev, While tracking down a connectivity issue, we identified that two of our hosts are unable to talk to each other due to a misconfiguration of the network. This manifested as: 2017-12-21T11:00:34.840Z DEBUG <> [default-pool-34] o.e.j.client.AbstractConnectionPool - Connection

Re: RFR: 8176188: jdk/internal/misc/JavaLangAccess/NewUnsafeString.java failing since 9-b93

2017-12-04 Thread Steven Schlansker
> On Dec 4, 2017, at 3:46 PM, Martin Buchholz wrote: > > The code in Long.fastUUID is indeed ugly. I've never heard of UUID > creation being a bottleneck. At Google it sometimes seems all our java > performance problems are with zip file manipulation. At $MY_WORK, we

Re: Random.nextLong(long bound)?

2017-10-18 Thread Steven Schlansker
> On Oct 18, 2017, at 3:15 PM, Martin Buchholz wrote: > > Why not SplittableRandom? > https://docs.oracle.com/javase/9/docs/api/java/util/SplittableRandom.html#nextLong-long- In this particular case, an algorithm written by a library vendor takes a parameter of type

Random.nextLong(long bound)?

2017-10-18 Thread Steven Schlansker
My coworker is implementing an algorithm for which he needs a bounded random long. He needs to be in full control of the seed and not share the instance (i.e. not use ThreadLocalRandom). Random helpfully provides a nextInt(int bound) but nextLong has no such overload. The code to do so is not

Re: RFR 9: 8165641 : Deprecate Object.finalize

2017-03-14 Thread Steven Schlansker
> On Mar 14, 2017, at 12:25 PM, Timo Kinnunen wrote: > > Hi, > > Maybe rather than “an ugly waste of memory” which sounds somewhat negative, > we could instead call it “an honestly assessed true resource cost”? > Yuck! I'm imagining opening 32k file descriptors

Re: Proposal: java.lang.reflect.Proxy and default methods

2017-03-01 Thread Steven Schlansker
> On Mar 1, 2017, at 1:14 PM, mp911de wrote: > > Is there any progress on this issue? In the light of Java 9, the workaround > with > MethodHandles.lookup()/unreflectSpecial does not work anymore because > MethodHandles is encapsulated and calling setAccessible(true) on the

Duration isPositive missing?

2016-12-16 Thread Steven Schlansker
Hi core-libs-dev, My coworker and I were just puzzling over the seemingly trivially missing java.time.Duration#isPositive There are already "isNegative" and "isZero" -- but for isPositive the best we came up with were awful things like !isZero() && !isNegative() !.negate().isNegative()

Re: Proposal: Add a type token class for representing generic types

2016-12-16 Thread Steven Schlansker
> On Dec 16, 2016, at 8:18 AM, Gunnar Morling wrote: > > Hi, > > I'd like to suggest the addition of a type token class to the Java > class library, to be used for representing generic types such as > List. I don't have much clout on this list to throw around, but a huge

Re: Proposal: java.lang.reflect.Proxy and default methods

2016-06-16 Thread Steven Schlansker
Hi everyone, I am glad this was discussed on the list again. I just wanted to throw out there, as a library developer and end user, I now have had to reproduce this hack in no fewer than four different projects for various reasons. It is even worse because it means that my library cannot run

Re: JEP 118 Parameter Names by default

2016-05-03 Thread Steven Schlansker
; > I found this old email reply to someone who asked a similar question. > Maybe the same reasoning still applies: > > http://mail.openjdk.java.net/pipermail/enhanced-metadata-spec-discuss/2013-May/000201.html > > -Michael > > On Wed, Apr 27, 2016 at 1:18 PM, Steven Schl

JEP 118 Parameter Names by default

2016-04-27 Thread Steven Schlansker
Hi core-libs-dev, Apologies in advance if this is the wrong list, I was torn between this one and compiler-dev, but I'm already subscribed here so we'll try this first :) I am trying to understand why the javac '-parameters' option is not enabled by default. Normally it would not be too

UNIXProcess.toString -- include more useful information

2016-04-25 Thread Steven Schlansker
Hi core-libs-dev, I recently was diagnosing a problem relating to an external program invoked via the ProcessBuilder API. The returned Process is an instance of java.lang.UNIXProcess, which does not have a toString method. While I understand that the concepts of "pid" etc are not

Re: RFR(m): 8145468u1 deprecations for java.lang

2016-04-18 Thread Steven Schlansker
> On Apr 18, 2016, at 3:30 PM, Stuart Marks wrote: > > On 4/17/16 7:06 AM, Dave Brosius wrote: >> Along these lines, is there a reason not to deprecate the >> >> String(String s) >> >> constructor? Now that substring doesn't glom off the original string, i see >> no

Re: RFR 9: 8138696 : java.lang.ref.Cleaner - an easy to use alternative to finalization

2015-12-08 Thread Steven Schlansker
On Dec 8, 2015, at 10:51 AM, Peter Levart wrote: > On 12/08/2015 04:34 PM, Roger Riggs wrote: >> >>private final Cleaner.Cleanable cleanable = cleaner.register(this, () >> -> fd.close()); > > Sorry Roger, but this example is flawed. This is tricky! The lambda

Re: RFR(L): JDK-8046936 : JEP 270: Reserved Stack Areas for Critical Sections

2015-11-24 Thread Steven Schlansker
On Nov 24, 2015, at 8:46 AM, Karen Kinnear wrote: > Doug, > > I have been thinking about this more from the perspective of the original > problem > we set out to solve I apologize if this has already been considered -- but for a lot well designed systems,

Re: Exception handling in Files.walk and Files.find

2015-07-02 Thread Steven Schlansker
How about BiConsumerPath, IOException, unless the Path is easily accessible otherwise? On Jul 2, 2015, at 6:56 AM, Peter Levart peter.lev...@gmail.com wrote: Hi, Recently I wanted to use Files.walk method returning a StreamPath to scan a directory of files. I quickly learned that it is of

Re: Naming of thread pools (Executors)

2015-05-18 Thread Steven Schlansker
On May 17, 2015, at 9:32 PM, Aleksey Shipilev aleksey.shipi...@oracle.com wrote: On 05/17/2015 10:55 AM, Peter Hansson wrote: Hi, I would like create a patch for https://bugs.openjdk.java.net/browse/JDK-8016248. MOTIVATION: Today thread pools created by the Executors method are

Re: Optional.orElseChain ?

2015-04-17 Thread Steven Schlansker
On Apr 17, 2015, at 2:37 PM, Remi Forax fo...@univ-mlv.fr wrote: As you can see the code is not bad but the code of chain() could be simplified if there was a way on Optional to call a Supplier of Optional if an Optional is empty. Currently, orElse() takes a value, orElseGet takes a lambda

java.time.Clock$TickClock wrong javadoc

2014-09-22 Thread Steven Schlansker
Hi core-libs-dev, Quick note that it seems that the Javadoc for Clock$TickClock has copypasta from Clock$OffsetClock. Not a huge deal for a non-public class but probably worth fixing. http://hg.openjdk.java.net/jdk9/client/jdk/file/5edbebb72540/src/java.base/share/classes/java/time/Clock.java

Re: please review draft JEP: Convenience Factory Methods for Collections

2014-07-17 Thread Steven Schlansker
On Jul 16, 2014, at 5:46 PM, Stuart Marks stuart.ma...@oracle.com wrote: Hi all, Please review this draft JEP for Convenience Factory Methods for Collections: https://bugs.openjdk.java.net/browse/JDK-8048330 Brief background: several times over the years there have been proposals to

Re: UUID.compareTo broken?

2014-04-10 Thread Steven Schlansker
On Apr 9, 2014, at 2:21 AM, Paul Sandoz paul.san...@oracle.com wrote: On Apr 8, 2014, at 9:15 PM, Mike Duigou mike.dui...@oracle.com wrote: That seems a terribly broken usage of UUID for 128 bit numbers or a pair of signed 64 bit numbers :-) Part of me thinks we should not be supporting

Re: UUID.compareTo broken?

2014-04-08 Thread Steven Schlansker
On Apr 8, 2014, at 1:03 AM, Paul Sandoz paul.san...@oracle.com wrote: On Apr 7, 2014, at 7:23 PM, Mike Duigou mike.dui...@oracle.com wrote: I also note that UUID does not currently support version 5, SHA-1, which it should. I am hoping to do other performance work on UUID within the

Re: Implicit 'this' return for void methods

2014-03-28 Thread Steven Schlansker
On Mar 28, 2014, at 10:52 AM, Marek Kozieł develop4l...@gmail.com wrote: Hi, I really do not know why some proposals are restored back from the grave, without answering for questions that was already made: http://mail.openjdk.java.net/pipermail/jdk8-dev/2011-December/000382.html Problem

Re: Implicit 'this' return for void methods

2014-03-27 Thread Steven Schlansker
On Mar 27, 2014, at 9:35 AM, Jochen Theodorou blackd...@gmx.org wrote: Am 26.03.2014 16:51, schrieb Guy Steele: [...] I am wholeheartedly in favor of allowing “chaining” of dotted expressions such as CharBuffer.allocate(26).position(2).put(C).position(25).put(Z”) this also shows a

Re: RFR: patch to reduce use of many temporary objects in java.util.UUID

2013-11-11 Thread Steven Schlansker
will take the good parts from my patch and the good parts from your patch and make an even better patch :) Regards, Steven Schlansker

Re: RFR: patch to reduce use of many temporary objects in java.util.UUID

2013-11-11 Thread Steven Schlansker
On Nov 11, 2013, at 10:55 AM, Andreas Rieber rieberandr...@gmail.com wrote: On 11.11.2013 19:39, Steven Schlansker wrote: Sorry I don’t have the best list message references here, Oracle seems to have decided to break all the links through the old Sun bug database, so all my references

Re: Debug builds

2013-10-07 Thread Steven Schlansker
On Oct 7, 2013, at 8:30 AM, cowwoc cow...@bbs.darktech.org wrote: Hi, Where did the old debug builds of rt.jar go (meaning, rt.jar with full debug symbols, even for local variables)? I scanned the mailing list for a related discussion but couldn't find anything. It looks like

Re: JDK 8 RFC 6470700: Math.random() / Math.initRNG() uses double checked locking

2013-08-21 Thread Steven Schlansker
On Aug 21, 2013, at 4:37 PM, Brian Burkhalter brian.burkhal...@oracle.com wrote: With respect to this issue http://bugs.sun.com/view_bug.do?bug_id=6470700 the code of concern from java.lang.Math is 701private static Random randomNumberGenerator; 702 703private static

Re: Dismal performance of String.intern()

2013-08-04 Thread Steven Schlansker
On Tue, 11 Jun 2013 10:28:14 +0100 Alan Bateman alan.bate...@oracle.com wrote: On 10/06/2013 19:06, Steven Schlansker wrote: Hi core-libs-dev, While doing performance profiling of my application, I discovered that nearly 50% of the time deserializing JSON was spent within String.intern

Re: StringJoiner: detect or fix delimiter collision?

2013-07-23 Thread Steven Schlansker
On Jul 23, 2013, at 1:37 PM, ph philip.hod...@bluewin.ch wrote: The omission of that very complexity is a copious source of bugs that breaks applications in production, and is extremely useful and interesting to the black hat community. It should not be possible to call a joiner without

Re: RFR 8017540: Improve multi-threaded contention behavior of BigInteger.toString() radix conversion cache

2013-06-25 Thread Steven Schlansker
On Jun 25, 2013, at 1:56 PM, Peter Levart peter.lev...@gmail.com wrote: Sorry, you are storing back when resizing. And you are resizing for every exponent that is bigger that previous requested (cached). This can lead to many resizings. Hi everyone, Apologies to butt in, and maybe this

Re: Dismal performance of String.intern()

2013-06-12 Thread Steven Schlansker
Thank you everyone for the valuable input! On Jun 11, 2013, at 1:52 AM, Aleksey Shipilev aleksey.shipi...@oracle.com wrote: On 06/11/2013 12:31 PM, Remi Forax wrote: On 06/10/2013 08:06 PM, Steven Schlansker wrote: Hi Steven, the main issue is that intern() doesn't work in isolation, I

Dismal performance of String.intern()

2013-06-10 Thread Steven Schlansker
Hi core-libs-dev, While doing performance profiling of my application, I discovered that nearly 50% of the time deserializing JSON was spent within String.intern(). I understand that in general interning Strings is not the best approach for things, but I think I have a decent use case -- the

Re: Dismal performance of String.intern()

2013-06-10 Thread Steven Schlansker
On Jun 10, 2013, at 3:55 PM, Andrew Haley a...@redhat.com wrote: On 06/10/2013 07:06 PM, Steven Schlansker wrote: I discovered that replacing String.intern() with a ConcurrentHashMap improved performance by almost an order of magnitude. I'm not the only person that discovered

Re: Dismal performance of String.intern()

2013-06-10 Thread Steven Schlansker
On Jun 10, 2013, at 3:55 PM, Andrew Haley a...@redhat.com wrote: On 06/10/2013 07:06 PM, Steven Schlansker wrote: I discovered that replacing String.intern() with a ConcurrentHashMap improved performance by almost an order of magnitude. I'm not the only person that discovered

Re: Is there a better way to throw this exception?

2013-06-06 Thread Steven Schlansker
On Jun 6, 2013, at 2:42 AM, Weijun Wang weijun.w...@oracle.com wrote: Hi All I have a method that could throw two kinds of checked exceptions and possibly other unchecked ones: void once() throws One, Two Now I have a wrapper method that calls once() for multiple times, and want to

Re: Is there a better way to throw this exception?

2013-06-06 Thread Steven Schlansker
On Jun 6, 2013, at 2:42 AM, Weijun Wang weijun.w...@oracle.com wrote: Hi All I have a method that could throw two kinds of checked exceptions and possibly other unchecked ones: void once() throws One, Two Now I have a wrapper method that calls once() for multiple times, and want to

Re: RFR: String.join(), StringJoiner additions

2013-04-15 Thread Steven Schlansker
On Apr 15, 2013, at 12:21 PM, Martin Buchholz marti...@google.com wrote: On Mon, Apr 15, 2013 at 11:31 AM, Martin Buchholz marti...@google.comwrote: OTOH, I'm guessing you are trying to improve the performance of operations like List.toString. More efficient (single copy char[]) would be

Re: Throwable.addSuppressed error conditions -- use the exception as the cause?

2013-04-12 Thread Steven Schlansker
On Apr 11, 2013, at 9:04 PM, Zhong Yu zhong.j...@gmail.com wrote: On Tue, Apr 9, 2013 at 11:54 AM, Steven Schlansker stevenschlans...@gmail.com wrote: I agree, but there is (library) code out there that does this -- the code that caused the problem wasn't even mine. The library should

Re: Throwable.addSuppressed error conditions -- use the exception as the cause?

2013-04-09 Thread Steven Schlansker
On Apr 9, 2013, at 9:30 AM, Zhong Yu zhong.j...@gmail.com wrote: On Mon, Apr 8, 2013 at 6:54 PM, Steven Schlansker stevenschlans...@gmail.com wrote: Today I encountered java.lang.IllegalArgumentException: Self-suppression not permitted from Throwable.addSuppressed. My first

Throwable.addSuppressed error conditions -- use the exception as the cause?

2013-04-08 Thread Steven Schlansker
Today I encountered java.lang.IllegalArgumentException: Self-suppression not permitted from Throwable.addSuppressed. My first surprise is that the try-with-resources block can throw this exception; it is very confusing to have auto-generated code throw exceptions. But beyond that, it is

Re: RFR (S) CR 8006627/8007398: Improve performance of Long.toUnsignedString0, Integer.toUnsignedString0, UUID(String) and UUID.toString

2013-03-20 Thread Steven Schlansker
On Feb 13, 2013, at 2:45 PM, Mike Duigou mike.dui...@oracle.com wrote: I have updated the patch with some of Ulf's feedback and corrected one cut-and-paste error that I made. The updated webrev is at: http://cr.openjdk.java.net/~mduigou/JDK-8006627/2/webrev/ One last ping to make

Re: RFR (S) CR 8006627: Improving performance and reducing object allocations of java.util.UUID to/from string

2013-02-11 Thread Steven Schlansker
it to Java 7. Please let me know if I can be of any help in a way that doesn't actually cost more work than I end up contributing :-) Mile On Feb 3 2013, at 21:26 , Steven Schlansker wrote: On Feb 1, 2013, at 11:42 AM, Mike Duigou mike.dui...@oracle.com wrote: I have created another issue

Re: RFR (S) CR 8006627: Improving performance and reducing object allocations of java.util.UUID to/from string

2013-02-03 Thread Steven Schlansker
On Feb 1, 2013, at 11:42 AM, Mike Duigou mike.dui...@oracle.com wrote: I have created another issue 8007398 for the changes to Long. We can even test and push the two issues at the same time. Separating them into two changesets makes the intent easier to follow for future maintainers.

Re: Improving performance and reducing object allocations of java.util.UUID to/from string

2013-01-28 Thread Steven Schlansker
On Jan 21, 2013, at 3:12 AM, Aleksey Shipilev aleksey.shipi...@oracle.com wrote: Ok, now as this is being taken care of, you need to follow these steps: a) prepare the code, and create the webrev [1] for the change. b) upload the webrev somewhere, submit the link to webrev for formal

RFR (S) CR 8006627: Improving performance and reducing object allocations of java.util.UUID to/from string

2013-01-28 Thread Steven Schlansker
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8006627 I have created a patch that dramatically improves UUID to/from string performance. Please find below a webrev with my proposed changes. Thanks in advance for any feedback on the contents. I do not believe I have a committer lined up

Re: Improving performance and reducing object allocations of java.util.UUID to/from string

2013-01-19 Thread Steven Schlansker
Thank you for the feedback! On Jan 10, 2013, at 4:50 AM, Aleksey Shipilev aleksey.shipi...@oracle.com wrote: On 01/09/2013 09:51 PM, Steven Schlansker wrote: Hello again, I sent this email a week ago and have received no replies. Is there any step I have missed necessary to contribute

Re: Improving performance and reducing object allocations of java.util.UUID to/from string

2013-01-09 Thread Steven Schlansker
On Dec 29, 2012, at 9:25 AM, Steven Schlansker stevenschlans...@gmail.com wrote: Hello core-libs-dev, My company uses UUIDs throughout our software. We recently identified that the java.util.UUID implementations of fromString and toString are horridly inefficient. An incomplete list

Improving performance and reducing object allocations of java.util.UUID to/from string

2012-12-29 Thread Steven Schlansker
a CLA, but my company is in the process of signing one. The rest of the message is a hg export of my change set, which is current to the tip of jdk7. Happy holidays, and thank you for your time! Steven Schlansker # HG changeset patch # User Steven Schlansker ste...@nesscomputing.com # Date