Re: Unsafe getLong/getLongVolatile has to read 8 bytes. It atomic / synchronized?

2023-06-09 Thread Remi Forax
If you can use Java 11, Take a look to the VarHandle API, using VarHandles is as fast as using Unsafe, but it does not crash. For an explanation of the different order modes, [ https://gee.cs.oswego.edu/dl/html/j9mm.html | https://gee.cs.oswego.edu/dl/html/j9mm.html ] Bonus answer: as far a

Re: Compute in a lock free way

2022-06-04 Thread Remi Forax
> From: "Dain Ironfoot" > To: "mechanical-sympathy" > Sent: Saturday, June 4, 2022 5:11:49 PM > Subject: Re: Compute in a lock free way > Thank you so much Remi!! > I took your advice of using CAS to update both of them and came up with this > (Can't use record as still on JDK 11). > Does this

Re: Compute in a lock free way

2022-06-04 Thread Remi Forax
- Original Message - > From: "Laurynas Biveinis" > To: "mechanical-sympathy" > Sent: Saturday, June 4, 2022 11:03:28 AM > Subject: Re: Compute in a lock free way >> I am writing a class to calculate average of prices. We use it to generate >> buy/sell signal for some financial instrument

Re: Compute in a lock free way

2022-06-04 Thread Remi Forax
> From: "Dain Ironfoot" > To: "mechanical-sympathy" > Sent: Saturday, June 4, 2022 12:53:55 AM > Subject: Compute in a lock free way > Hello, > I am writing a class to calculate average of prices. We use it to generate > buy/sell signal for some financial instruments therefore latency is crucial

Re: Megamorphic virtual call optimization in Java

2022-02-05 Thread Remi Forax
> From: "r r" > To: "mechanical-sympathy" > Sent: Saturday, February 5, 2022 12:20:12 PM > Subject: Megamorphic virtual call optimization in Java > Hello, > we know that there are some techniques that make virtual calls not so > expensive > in JVM like Inline Cache or Polymorphic Inline Cache.

Re: Tools for understanding GPUs?

2021-03-22 Thread Remi Forax
> De: "Henri Tremblay" > À: "mechanical-sympathy" > Envoyé: Lundi 22 Mars 2021 12:17:23 > Objet: Re: Tools for understanding GPUs? > I learned playing with Aparapi ( [ https://aparapi.com/ | > https://aparapi.com/ ] > ). > It's not super complicated but you need to jump right in mechanical symp

Re: Best way to dynamically spin Java classes?

2020-05-01 Thread Remi Forax
.lang.invoke to set it after the fact. > Anyway very cool what defineHiddenClass will enable. yes, all these features were available but only internally for the jdk, i think since jdk 7, finding a safe way to expose them take times. regards, Rémi > On Sunday, Apri

Re: Best way to dynamically spin Java classes?

2020-04-26 Thread Remi Forax
Shameless plug, i've written a simple library that shows how lookup.defineHiddenClass [1] can be used to implement dynamic proxies [ https://github.com/forax/hidden_proxy | https://github.com/forax/hidden_proxy ] regards, Rémi [1] [ https://download.java.net/java/early_access/jdk15/docs/a

Re: does call site polymorphism factor in method overrides?

2019-12-30 Thread Remi Forax
> De: "Vitaly Davidovich" > À: "mechanical-sympathy" > Envoyé: Lundi 30 Décembre 2019 19:43:27 > Objet: Re: does call site polymorphism factor in method overrides? > On Mon, Dec 30, 2019 at 1:09 PM Remi Forax < [ mailto:fo...@univ-mlv.fr | > fo...@univ

Re: does call site polymorphism factor in method overrides?

2019-12-30 Thread Remi Forax
> De: "Brian Harris" > À: "mechanical-sympathy" > Envoyé: Lundi 30 Décembre 2019 17:13:38 > Objet: Re: does call site polymorphism factor in method overrides? > Good to know Vitaly! > So a poor example then. Better example is an abstract class with a method > implementation that no subtypes over

Re: Exotic classes

2019-04-27 Thread Remi Forax
are not using the same set of fields, grouping together the implementation of equals and hashCode alleviate this issue. > I feel like ObjectSupport is a bit nebulous and open ended and you'd > inevitably > end up needing more support methods such as a toString method. yes, toString

Re: Exotic classes

2019-04-26 Thread Remi Forax
> De: "Steven Stewart-Gallus" > À: "mechanical-sympathy" > Envoyé: Vendredi 26 Avril 2019 01:51:47 > Objet: Re: Exotic classes Hi Steven, thanks for spending some time on this, > 1. Why > public abstract class ObjectSupport { > public abstract boolean equals ( Object self , Object other ); > p

Re: Exotic classes

2019-04-24 Thread Remi Forax
> De: "mechanical-sympathy" > À: "mechanical-sympathy" > Envoyé: Mardi 23 Avril 2019 18:23:48 > Objet: Re: Exotic classes > Replies inline > On Monday, April 22, 2019 at 12:37:19 PM UTC-7, Remi Forax wrote: >>> De: "mechanic

Re: Exotic classes

2019-04-22 Thread Remi Forax
ze later. so there is a good chance that what you are measuring is not all de-optimization cost. Rémi > On Monday, February 26, 2018 at 11:29:19 AM UTC-8, Remi Forax wrote: >> Hi all, >> i'm preparing a talk at DevoxxFR on how to make a field value, a returned >> val

Re: Exotic classes

2019-02-06 Thread Remi Forax
Hi Steven, > De: "Steven Stewart-Gallus" > À: "mechanical-sympathy" > Envoyé: Samedi 19 Janvier 2019 05:19:06 > Objet: Re: Exotic classes > On Friday, January 18, 2019 at 5:37:58 AM UTC-8, Rémi Forax wrote >>> no, CHA only works on class, not on interface. > You're probably know better than me

Re: Exotic classes

2019-01-18 Thread Remi Forax
> De: "Steven Stewart-Gallus" > À: "mechanical-sympathy" > Envoyé: Jeudi 17 Janvier 2019 07:50:13 > Objet: Re: Exotic classes > I've been working on similar issues trying to optimise something > heavily. I made a similar class to this one (I even had a similar > API) but I found I called it Mos

Re: jHiccup for .NET?

2018-08-29 Thread Remi Forax
> De: "Gil Tene" > À: "mechanical-sympathy" > Envoyé: Mardi 28 Août 2018 00:28:00 > Objet: Re: jHiccup for .NET? > There is [ https://github.com/HdrHistogram/HdrHistogram.NET | a great > implementation of HdrHistogram for .NET ] , which makes the rest of what > jHiccup does nearly-trivial to do.

Exotic classes

2018-02-26 Thread Remi Forax
Hi all, i'm preparing a talk at DevoxxFR on how to make a field value, a returned value, etc constant for any decent JITs (everything but c1), so i've bundled together several patterns i use for implementing dynamic language runtimes into an Java API https://github.com/forax/exotic I would l

Re: Call site (optimizations)

2018-01-31 Thread Remi Forax
> De: "Francesco Nigro" > À: "mechanical-sympathy" > Envoyé: Mardi 30 Janvier 2018 15:13:03 > Objet: Re: Call site (optimizations) > Gil really thank you for the super detailed answer! > I'm digesting it and I've found an interesting talk with some of these > concepts > referenced/mentioned: h

Re: Minimal Value Type

2017-12-27 Thread Remi Forax
r 27, 2017 at 7:54:11 AM UTC-7, Henri Tremblay wrote: >>> Hi Rémi, >>> Highly interesting. >>> For those like me who are too lazy to read an annotated JVM spec, are you >>> aware >>> of a quick summary of how it works somewhere? (over (how to specify

Minimal Value Type

2017-12-27 Thread Remi Forax
Hi all, seeing the mail from Peter on how to avoid pointer chasing, instead of using off-heap data structure, use value types. Currently, there is a prototype, named the Minimal Value Type, that allows people to test value types inside the VM. The spec is here: http://cr.openjdk.java.net/~dls

Re: Executing thread by JVM.

2017-11-12 Thread Remi Forax
> De: "John Hening" > À: "mechanical-sympathy" > Envoyé: Lundi 13 Novembre 2017 00:17:32 > Objet: Executing thread by JVM. > Hello, > I would like to ask for threads in Java. As we know, JVM uses system threads > (native threads). So, for example it uses Linux threads. In simplification a > thr

Re: Modern Garbage Collection (good article)

2016-12-22 Thread Remi Forax
worrying. > Mind you, I'm not a fan nor a user of Go so I'm referring purely to their > stipulated strategy on how to evolve their GC. Rémi > On Thu, Dec 22, 2016 at 7:37 AM Remi Forax < fo...@univ-mlv.fr > wrote: >>> De: "Vitaly Davidovich" <

Re: Modern Garbage Collection (good article)

2016-12-22 Thread Remi Forax
> De: "Vitaly Davidovich" > À: mechanical-sympathy@googlegroups.com > Envoyé: Jeudi 22 Décembre 2016 13:12:00 > Objet: Re: Modern Garbage Collection (good article) > FWIW, I think the Go team is right in favoring lower latency over throughput > of > their GC given the expected usage scenarios fo

Re: private final static optimization

2016-12-18 Thread Remi Forax
Hi Vitaly, > De: "Vitaly Davidovich" > À: mechanical-sympathy@googlegroups.com > Envoyé: Dimanche 18 Décembre 2016 19:00:04 > Objet: Re: private final static optimization > It doesn't care about reflection - modifying final fields via reflection is > undefined by the JLS. Unfortunately, the sam