drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vrozov <...@git.apache.org>
Subject [GitHub] drill pull request #1090: DRILL-6080: Sort incorrectly limits batch size to ...
Date Sat, 13 Jan 2018 23:55:43 GMT
Github user vrozov commented on a diff in the pull request:

    --- Diff: exec/memory/base/src/main/java/io/netty/buffer/DrillBuf.java ---
    @@ -851,48 +851,52 @@ public void print(StringBuilder sb, int indent, Verbosity verbosity)
        * Write an integer to the buffer at the given byte index, without
        * bounds checks.
    -   * @param offset byte (not int) offset of the location to write
    +   * @param bufOffset byte (not int) offset of the location to write
        * @param value the value to write
    -  public void unsafePutInt(int offset, int value) {
    -    PlatformDependent.putInt(addr + offset, value);
    +  public void unsafePutInt(int bufOffset, int value) {
    +    assert unsafeCheckIndex(bufOffset, 4);
    --- End diff --
    I don't think that `unsafePutXXX()` provides any performance benefits over existing `setXXX()`
variants after DRILL-6004 was merged, except that unsafe variants use `assert` while existing
use `final static boolean` flag that functionally and performance wise is equivalent to java
`assert`. It is necessary to agree on a single mechanism to enable bounds checking and use
it in all methods.


View raw message