My understanding is there is a single machine code instruction to swap the bytes around and this is done in the cpu. Compare this to the cost of cache access and bound checks and swapping the bytes doesn't make much difference.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
This is an issue when doing copy memory from/to on-heap arrays to unsafe memory.
Am Montag, 2. September 2013 05:58:09 UTC+2 schrieb Kevin Burton:A few of my benchmarking adventures in the last few months didn't make a ton of sense and I'm still trying to track down exactly why...One is using a big endian vs little endian ByteBuffer. They seem to be somewhat on par in terms of performance. Big endian on x86 in my benchmarks was slower, but not SHOCKINGLY slower.I'm wondering how much of this might have to do with superscalar CPUs instruction parallelism. It might be that two benchmarks execute at the same rate but one uses far more instructions to execute (which are resources that could otherwise be used).Tools like caliper might need to be augmented to support perf and the modern processor tooling to expose this utilization.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
Peter,I fully agree, but Rudiger mentioned looping with getXX, putXX over memory region that's supposed to contain array entries. Maybe I'm missing something here but on-heap stuff may change it's memory location over time, hence my question about preserving consistency.
Whether you are working on heap or off heap, The operations are the same ones that AtomicReference, AtomicInteger and AtomicLong use. Basically getVolatileInt/Long, putOrderedInt/Long, compareAndSwapInt/Lomg and if needed putVolatileInt/Long
On 2 September 2013 22:24, Wojciech Kudla <wojciec...@gmail.com> wrote:
This is an issue when doing copy memory from/to on-heap arrays to unsafe memory.
Rudiger,I'm very interested in learning how you manage to guarantee consistency when conducting unsafe access on on-heap objects.
Am Montag, 2. September 2013 05:58:09 UTC+2 schrieb Kevin Burton:A few of my benchmarking adventures in the last few months didn't make a ton of sense and I'm still trying to track down exactly why...One is using a big endian vs little endian ByteBuffer. They seem to be somewhat on par in terms of performance. Big endian on x86 in my benchmarks was slower, but not SHOCKINGLY slower.I'm wondering how much of this might have to do with superscalar CPUs instruction parallelism. It might be that two benchmarks execute at the same rate but one uses far more instructions to execute (which are resources that could otherwise be used).Tools like caliper might need to be augmented to support perf and the modern processor tooling to expose this utilization.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
That is my understanding, however it would do it without a safe point in between i.e. a GC cannot be performed just anywhere. (Though this is how it appears at the Java level)The downside of this is these safepoint checks is they can really slow down your system in some cases and make it behave badly, but that is a different issue. At least you can be sure a GC cannot be started without every thread reaching one of these safe points.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsubscribe...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsubscribe...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsubscribe...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsubscribe...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsubscribe...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsubscribe...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsubscribe...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.