Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vietj/perf-experiments
Various performance experiments
https://github.com/vietj/perf-experiments
Last synced: 5 days ago
JSON representation
Various performance experiments
- Host: GitHub
- URL: https://github.com/vietj/perf-experiments
- Owner: vietj
- License: apache-2.0
- Created: 2017-12-19T10:05:49.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-24T06:54:10.000Z (over 6 years ago)
- Last Synced: 2024-11-08T20:49:54.394Z (about 2 months ago)
- Language: Java
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Various performance experiments in Java
## Find first special byte benchmark
Attempt to reproduce the optimization explained in this article https://chadaustin.me/2017/05/writing-a-really-really-fast-json-parser/
in Java using various memory access.The problem at hand: given a pointer to the first byte after the opening quote of a string, find the
first special byte, where special bytes are “, \, <0x20, or >0x7f.Build the fat jar
```
> mvn clean package
```Run the benchmark at different sizes: 256, 4096, 65536
```
> java -jar target/benchmarks.jar FindFirstSpecialByteBenchmark
```Or at a specific size
```
> java -jar target/benchmarks.jar -p size=256 FindFirstSpecialByteBenchmark
```## Perfasm
On OSX:
```
> java .... -prof dtraceasm
```### requires hsdis
```
#!/bin/bash -e# Download OpenJDK Reference Implementation Sources from
# http://jdk.java.net/java-se-ri/10
curl -O https://download.java.net/openjdk/jdk10/ri/openjdk-10_src.zip# Navigate to the hsdis sources
unzip openjdk-10_src.zip
cd openjdk/src/utils/hsdis# Download binutils 2.26
curl -O https://mirrors.syringanetworks.net/gnu/binutils/binutils-2.26.tar.gz
tar xzvf binutils-2.26.tar.gz# Build hsdis
make BINUTILS=binutils-2.26 all64# Install hsdis
sudo cp build/macosx-amd64/hsdis-amd64.dylib /Library/Java/JavaVirtualMachines/jdk-10.jdk/Contents/Home/lib/server
```### disable SIP
http://osxdaily.com/2015/10/05/disable-rootless-system-integrity-protection-mac-os-x/