Re: To increase speed on manipulating big arrays in Java with minimal bounds checking, ...
- From: "Robert Klemme" <bob.news@xxxxxxx>
- Date: Wed, 31 Aug 2005 14:40:46 +0200
Chris Uppal wrote:
> Casey Hawthorne wrote:
>
>> To increase speed on manipulating big arrays in Java with minimal
>> bounds checking, would it be possible to have some operators that
>> only do bounds checking at the boundaries of the array?
>
> You could always write custom array operations in JNI. Otherwise the
> answer is no (not without a change to the JVM design, which isn't
> going to happen).
I'm not sure whether array accesses via JNI actually bypass bounds checks.
You probably would have to copy the Java array into a native array,
perform the algorithm on it and copy results back. This sounds quite
imperformant to me.
> OTOH, it is /said/ (I find it plausible, but I can't confirm it from
> personal knowledge) that the big name JVM's JITers are pretty
> aggressive about removing bounds checks in the generated code, so
> there might not be much to gain from special operators.
Also: what do you gain by a specific operator to be used on boundaries?
If you *know* you're at a boundary why then even bother to check? Bounds
checking is there to prevent accidental violations - something that would
lead to undefined behavior or even crashes if omitted.
Kind regards
robert
.
- Follow-Ups:
- References:
- Prev by Date: Re: HttpUtils.getRequestURL()
- Next by Date: Re: Duplex socket receiving data too fast?
- Previous by thread: Re: To increase speed on manipulating big arrays in Java with minimal bounds checking, ...
- Next by thread: Re: To increase speed on manipulating big arrays in Java with minimal bounds checking, ...
- Index(es):
Relevant Pages
|