Skip to content

Instantly share code, notes, and snippets.

View HyukjinKwon's full-sized avatar

Hyukjin Kwon HyukjinKwon

View GitHub Profile
[run]
branch = true
parallel = true
data_file = ${COVERAGE_DIR}/coverage_data/coverage
[html]
ignore_errors = true
@HyukjinKwon
HyukjinKwon / ByteBufferPerf.scala
Created December 16, 2016 04:02 — forked from rxin/ByteBufferPerf.scala
Comparison of performance over various approaches to read Java ByteBuffer. The best way is to use Unsafe, which also enables reading multiple primitive data types from the same buffer.
/**
* To compile:
* scalac -optimize ByteBufferPerf.scala
*
* JAVA_OPTS="-Xmx2g" scala IntArrayPerf 10
* 49 62 48 45 48 45 48 50 47 45
*
* JAVA_OPTS="-Xmx2g" scala ByteBufferPerf 10
* 479 491 484 480 484 481 477 477 472 473