Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v3]

2024-06-22 Thread Claes Redestad
On Wed, 3 Apr 2024 16:17:57 GMT, ExE Boss wrote: >> Jan Lahoda has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains six commits: >> >> - Reflecting review feedback. >> - Merge branch 'master' into JDK-8291966 >> - Adding comments

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v3]

2024-06-22 Thread ExE Boss
On Mon, 29 May 2023 07:25:26 GMT, Jan Lahoda wrote: >> The pattern matching switches are using a bootstrap method >> `SwitchBootstrap.typeSwitch` to implement the jumps in the switch. >> Basically, for a switch like: >> >> switch (obj) { >> case String s when s.isEmpty() -> {} >> case

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v3]

2024-04-03 Thread ExE Boss
On Mon, 29 May 2023 07:25:26 GMT, Jan Lahoda wrote: >> The pattern matching switches are using a bootstrap method >> `SwitchBootstrap.typeSwitch` to implement the jumps in the switch. >> Basically, for a switch like: >> >> switch (obj) { >> case String s when s.isEmpty() -> {} >> case

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v3]

2023-06-05 Thread ExE Boss
On Wed, 31 May 2023 14:05:56 GMT, Jan Lahoda wrote: >> Jan Lahoda has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains six commits: >> >> - Reflecting review feedback. >> - Merge branch 'master' into JDK-8291966 >> - Adding

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v3]

2023-05-31 Thread Jan Lahoda
On Mon, 29 May 2023 07:25:26 GMT, Jan Lahoda wrote: >> The pattern matching switches are using a bootstrap method >> `SwitchBootstrap.typeSwitch` to implement the jumps in the switch. >> Basically, for a switch like: >> >> switch (obj) { >> case String s when s.isEmpty() -> {} >> case

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v2]

2023-05-31 Thread Francesco Nigro
On Tue, 30 May 2023 09:32:02 GMT, Jan Lahoda wrote: >> @forax >> >> Hi! Sorry for this sudden message, but this one captured my attention >> >>> and subtype checks are usually fast. >> >> And I hope this PR to be the right place to raise this. >> >> I was looking this PR to better

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v2]

2023-05-30 Thread Jan Lahoda
On Mon, 29 May 2023 07:33:36 GMT, Francesco Nigro wrote: >> Also there is a lot of use cases where the type switch is called only with >> instances of the same class, for those scenarii, the VM should be able to >> fully remove the type switch and inline the body of the corresponding case >>

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v2]

2023-05-29 Thread Francesco Nigro
On Tue, 2 May 2023 13:57:37 GMT, Rémi Forax wrote: >> Jan Lahoda has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains four additional >> commits

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v2]

2023-05-29 Thread Jan Lahoda
On Tue, 17 Jan 2023 15:55:40 GMT, Jan Lahoda wrote: >> The pattern matching switches are using a bootstrap method >> `SwitchBootstrap.typeSwitch` to implement the jumps in the switch. >> Basically, for a switch like: >> >> switch (obj) { >> case String s when s.isEmpty() -> {} >> case

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v3]

2023-05-29 Thread Jan Lahoda
> The pattern matching switches are using a bootstrap method > `SwitchBootstrap.typeSwitch` to implement the jumps in the switch. Basically, > for a switch like: > > switch (obj) { > case String s when s.isEmpty() -> {} > case String s -> {} > case CharSequence cs -> {} > ... >

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v2]

2023-05-19 Thread Jan Lahoda
On Tue, 17 Jan 2023 15:55:40 GMT, Jan Lahoda wrote: >> The pattern matching switches are using a bootstrap method >> `SwitchBootstrap.typeSwitch` to implement the jumps in the switch. >> Basically, for a switch like: >> >> switch (obj) { >> case String s when s.isEmpty() -> {} >> case

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v2]

2023-05-12 Thread Adam Sotona
On Tue, 17 Jan 2023 15:55:40 GMT, Jan Lahoda wrote: >> The pattern matching switches are using a bootstrap method >> `SwitchBootstrap.typeSwitch` to implement the jumps in the switch. >> Basically, for a switch like: >> >> switch (obj) { >> case String s when s.isEmpty() -> {} >> case

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v2]

2023-05-02 Thread Rémi Forax
On Tue, 17 Jan 2023 15:55:40 GMT, Jan Lahoda wrote: >> The pattern matching switches are using a bootstrap method >> `SwitchBootstrap.typeSwitch` to implement the jumps in the switch. >> Basically, for a switch like: >> >> switch (obj) { >> case String s when s.isEmpty() -> {} >> case

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v2]

2023-05-02 Thread Jan Lahoda
On Fri, 28 Apr 2023 19:30:43 GMT, Neal Gafter wrote: > Building a map or hash table will be faster than sequential search. I agree it there will be usecases (and maybe even a majority of usecases) where using some kind of hash-based structure would work better than this patch. However, as

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v2]

2023-04-30 Thread Chen Liang
On Tue, 17 Jan 2023 15:55:40 GMT, Jan Lahoda wrote: >> The pattern matching switches are using a bootstrap method >> `SwitchBootstrap.typeSwitch` to implement the jumps in the switch. >> Basically, for a switch like: >> >> switch (obj) { >> case String s when s.isEmpty() -> {} >> case

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v2]

2023-04-30 Thread Rémi Forax
On Tue, 17 Jan 2023 15:55:40 GMT, Jan Lahoda wrote: >> The pattern matching switches are using a bootstrap method >> `SwitchBootstrap.typeSwitch` to implement the jumps in the switch. >> Basically, for a switch like: >> >> switch (obj) { >> case String s when s.isEmpty() -> {} >> case

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v2]

2023-04-30 Thread Neal Gafter
On Tue, 17 Jan 2023 15:55:40 GMT, Jan Lahoda wrote: >> The pattern matching switches are using a bootstrap method >> `SwitchBootstrap.typeSwitch` to implement the jumps in the switch. >> Basically, for a switch like: >> >> switch (obj) { >> case String s when s.isEmpty() -> {} >> case

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v2]

2023-01-17 Thread Jan Lahoda
> The pattern matching switches are using a bootstrap method > `SwitchBootstrap.typeSwitch` to implement the jumps in the switch. Basically, > for a switch like: > > switch (obj) { > case String s when s.isEmpty() -> {} > case String s -> {} > case CharSequence cs -> {} > ... >

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster

2022-09-29 Thread Andrey Turbanov
On Fri, 5 Aug 2022 16:12:08 GMT, Jan Lahoda wrote: > The pattern matching switches are using a bootstrap method > `SwitchBootstrap.typeSwitch` to implement the jumps in the switch. Basically, > for a switch like: > > switch (obj) { > case String s when s.isEmpty() -> {} > case String

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster

2022-08-09 Thread Thiago Henrique Hüpner
On Tue, 9 Aug 2022 10:28:02 GMT, Jan Lahoda wrote: > > Would it be possible to add a special case where the labels are all the > > same type? Like all labels are Class.class or Object.class? While testing > > out the pattern matching, I've found myself doing the following > > ```java > >

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster

2022-08-09 Thread Jan Lahoda
On Fri, 5 Aug 2022 16:12:08 GMT, Jan Lahoda wrote: > The pattern matching switches are using a bootstrap method > `SwitchBootstrap.typeSwitch` to implement the jumps in the switch. Basically, > for a switch like: > > switch (obj) { > case String s when s.isEmpty() -> {} > case String

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster

2022-08-08 Thread Remi Forax
- Original Message - > From: "Jan Lahoda" > To: "core-libs-dev" > Sent: Friday, August 5, 2022 11:03:06 PM > Subject: Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster > On Fri, 5 Aug 2022 20:20:56 GMT, Remi Forax wrote: > >>

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster

2022-08-08 Thread Thiago Henrique Hüpner
On Fri, 5 Aug 2022 16:12:08 GMT, Jan Lahoda wrote: > The pattern matching switches are using a bootstrap method > `SwitchBootstrap.typeSwitch` to implement the jumps in the switch. Basically, > for a switch like: > > switch (obj) { > case String s when s.isEmpty() -> {} > case String

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster

2022-08-05 Thread Jan Lahoda
On Fri, 5 Aug 2022 20:20:56 GMT, Remi Forax wrote: > You only need restart index at the beginning and after a when, so in your > example, only 0 and 1 are required, you can skip the generation of 2 because > you will never restart at 2. > The bootstrap protocol does not specify which cases

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster

2022-08-05 Thread Remi Forax
- Original Message - > From: "Jan Lahoda" > To: "core-libs-dev" > Sent: Friday, August 5, 2022 6:22:48 PM > Subject: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster > The pattern matching switches are using a bootstrap method > `Sw