Skip to content

Instantly share code, notes, and snippets.

@vlsi
vlsi / 00findings.txt
Last active October 20, 2015 10:28
if (ArrayIndexOutOfBoundsException) {...}
This is a result of running https://github.com/vlsi/microbenches/commit/34c694dcb48acce0a37334631747fb371d80c80f
1) Best result for testSingle is for java7u55+catch(AIOOBE), however java7's results are not stable
2) java 7 results are very unstable:
For isntance:
# Warmup Iteration 1: 548,557 ns/op
...
# Warmup Iteration 6: 102,104 ns/op
...
@vlsi
vlsi / 00_summary.md
Last active December 2, 2015 16:52
Sample release logs of pgjdbc
/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
Vladimir Sitnikov is currently working on performance and scalability of NetCracker OSS.
Telecommunication companies world wide use NetCracker OSS for enterprise and network automation.
Vladimir is keen on Java and database performance: Oracle, PostgreSQL. He’s one of the committers
in the PostgreSQL JDBC driver project, and architect of many performance improvements.
Abstract.
Common Java wisdom is to use PreparedStatements and Batch DML in order to achieve top performance.
It turns out one cannot just blindly follow the best practices. In order to get high throughput, you need
to understand the specifics of the database in question, and the content of the data.
@vlsi
vlsi / 01_init.sql
Last active September 8, 2016 18:50
PostgreSQL index only scan for expression testing
drop table vlsi;
create table vlsi(pk int4, type numeric, vc varchar(500), num numeric);
insert into vlsi(pk, type,vc,num) select s.x, round(x/1000), md5('||x)||md5('||x+1)||md5(''||x+2), mod(x, 1000)
from generate_series(1,1000000) as s(x);
-- Several values exceeed 128 substr, so they require "table access"
insert into vlsi(pk, type,vc,num) select s.x+1000000, round(x/1000), lpad('a', 128, 'a')||'zxc'||s.x||'v', mod(x, 1000)
from generate_series(1,10) as s(x);
@vlsi
vlsi / 00_conclusions.md
Created February 4, 2017 17:35
JTextArea append benchmark

According to the measurements, replaceRange + append works faster than setText except for the case when text is fully replaced. In 100% replace case setText is on par with replaceRange + append (the results are within error bounds).

For small appends there's a win in terms of response time and memory allocation.

# JMH 1.12 (released 309 days ago, please consider updating!)
# VM version: JDK 1.8.0_102, VM 25.102-b14
# VM invoker: /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre/bin/java
@vlsi
vlsi / comma_sequence_per_line.csv
Created September 9, 2014 06:27
Sample data for crash in data.table/fread
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 9.
,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,",,",,",,",,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,",,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,
@vlsi
vlsi / hs_err_pid57596.log
Created November 4, 2017 08:37
shenandoah/jdk10 crash logs
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/Users/vladimirsitnikov/Documents/work/shenandoah/src/hotspot/share/opto/node.cpp:177), pid=57596, tid=27907
# assert(_refresh_tick < 2*100000) failed: DU iteration must converge quickly
#
# JRE version: OpenJDK Runtime Environment (10.0) (fastdebug build 10-internal+0-adhoc.vladimirsitnikov.shenandoah)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 10-internal+0-adhoc.vladimirsitnikov.shenandoah, mixed mode, tiered, compressed oops, g1 gc, bsd-amd64)
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
@vlsi
vlsi / readme.md
Last active March 7, 2018 06:12
JMeter suggestion: add comment that briefly describes test plan as an XML comment

Current JMeter's JMX files are not human-readable, and it is hard to review "diff" between two versions of a script.

I suggest adding a human-readable comment to the start of the file, so the diff between scripts can be easier to understand:

<?xml version="1.0" encoding="UTF-8"?>
<!--
Test plan:
   Thread group (146 threads, 1:00:00 duration)
      login (http sampler /login)
@vlsi
vlsi / keybase.md
Created September 9, 2019 12:38
keybase.md

Keybase proof

I hereby claim:

  • I am vlsi on github.
  • I am vlsi (https://keybase.io/vlsi) on keybase.
  • I have a public key ASC2sRZGT4IKWFFWjBEznXZ8DHXjdgWnotEDW-x6_eLlYAo

To claim this, I am signing this object: