Internal "native" ByteBuffer
's use BIG_ENDIAN
ByteOrder
; should use nativeOrder
for speed...
#945
Labels
ByteBuffer
's use BIG_ENDIAN
ByteOrder
; should use nativeOrder
for speed...
#945
Description
It seems that Java's default is to consider everything to be stored as
BIG_ENDIAN
internally (most significant bytes at lower memory addresses); however, the actual machine interface works faster as far as the JIT'ed machine codes when emulated native buffers (ByteBuffer
) arenativeOrder
as then a single machine instruction can be used to read/write (or even read/modify/write) the various primitives of different byte lengths. The trick then is to determine the most optimum place to convert between this endedness. It seems that this conversion MUST be made in order for text conversion to work properly (at least currently).So this issue is with attempting to implement
ByteOrder
nativeOrder
for emulated native memory while allowing the text conversion system to work (and hopefully at least as efficiently) as it currently does.Expected Behavior
No visible changes other than a gain in performance in handling the emulated native memory buffers.
Actual Behavior
A crash (at least on Windows) with an exception generated as follows:
Possible Fix
Find the appropriate place in the text processing code to convert between
nativeOrder
andBIG_ENDIAN
ByteOrder
for utilizedByteBuffer
's so this works but with a minimum cost in performance due to the conversions between endedness.Steps to Reproduce
Modify the Eta run time source as per the attached
.java
files (with one related to labelling threads with a text field in concurrency), do a "eta-build rts-clean" (after having built Eta from source), and running any program that prints to the screen, such as the attached "HelloWorld" project.Context
This is part of the speedups I am trying to accomplish related to array processing as per issue #940.
Your Environment
ModifiedJavaFiles.zip
eta-helloworld.zip
The text was updated successfully, but these errors were encountered: