(ヒープおよびダイレクトバッファによるByteBufferの性能差、およびUnsafeとのパフォーマンスも比較するよ!) (とりあえず計測結果を先に知りたい人は結論を見てね!) (ファイルのシーケンシャルリードを含むダイレクトバッファの使い方やパフォーマンス比較については次の日記に書きました。) 概要 思うところあって、ヒープ上のbyte[]をラップしたByteBufferと、ダイレクトバッファを確保しているByteBufferの場合とのint型としての連続アクセスした場合のパフォーマンスの違いについて調べてみることにした。 私の認識では、ダイレクトバッファへのアクセスは非ネイティブ側(つまりJavaコード側)からのアクセスではオーバヘッドが大きいため、特殊なシチュエーション以外では遅くなってしまうため、あまり使いどころのない機能だというものだったのだが、では、その使いどころとなる「特殊な
by Andrew Brampton (bramp.net) GitHub | JavaDoc This is a collection of tools that make use of the sun.misc.Unsafe class. This Unsafe class allows direct access to memory within the JVM, which is extremely dangerous, but fun :). unsafe-helper - Contains some simple methods that make using sun.misc.Unsafe easier. unsafe-collection - An example List modelled on the ArrayList, which instead of storin
Welcome to PRESIDENSLOT Welcome di PRESIDENSLOT! Kami sedang melakukan peningkatan sistem pada AdvantPlay Mini Game mulai 17 Agustus 2025 hingga 08 Agustus 2026 pukul 23:57. Untuk sementara fitur ini belum tersedia, namun akan kembali dengan performa yang lebih stabil dan optimal. Terima kasih atas kesabaran Anda. Pemeliharaan Terjadwal: Fairbet pada 14-Jan-2025 dari 12.00.00 sampai 01-Jan-2026 00
OpenJDK や Hotspot VM には sun.misc.Unsafe という内部APIがあり*1、これを使うと ByteBuffer.getInt や ByteBuffer.getLong よりも高速にバイト列から整数値をデコードできるという。これを駆使することで、Cで実装された拡張ライブラリに匹敵する速度を出せるらしい。 それが本当なら、データ圧縮やハッシュ関数、シリアライザ/デシリアライザなどの実装を高速化できる。例えば、lz4 や xxhash のJava実装が Unsafe API を使用している*2:jpountz/lz4-java Prestoも、中間データのシリアライズ/デシリアライズにはすべて Unsafe API を使っている*3。 そこで、実際にベンチマークしてみた。 ベンチマーク内容 10MBのランダムなバイト列を生成する 先頭から1バイト読み出す その1バ
Understanding how Core Java really works can help you write simpler, faster applications. OverviewJava has many areas which can be slow. However for every problem there is a solution. Many solutions/hacks require working around Java's protections but if you need low level performance it is still possible. Java makes high level programming simpler and easier at the cost of making low level programm
Since the first version of Java, day-by-day many developers have been trying to achieve at least as good of performance as in C/C++. JVM vendors are doing their best by implementing some new JIT algorithms, but there is still a lot to do, especially in how we use Java. For example, there is a lot to win in objects<->file serialization - notably in writing/reading objects that can readily fit in th
LArray can create arrays with more than 2G(2^31) entries. 2^31 -1 (2G) is the limitation of the default Java/Scala array size, because these arrays use 32-bit signed integer (int) as indexes. LArray uses long type indexes of 64-bit signed integers to resolve this limitation. For example, the entire human genome data (3GB) can be stored in LArray. LArray can be released immediately from the memory.
Do you ever wish you could turn a Java object into a stream of bytes as fast as it can be done in a native language like C++? If you use standard Java Serialization you could be disappointed with the performance. Java Serialization was designed for a very different purpose than serialising objects as quickly and compactly as possible. Why do we need fast and compact serialisation? Many of our s
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く