Comments (6)
Thanks, I will try (micro)benchmarking this. It is difficult to say for sure, given how much hotspot rearranges things, but I agree in that conditional expressions can be much more costly (due to branching etc).
from compress.
Hmmh. Replacement with byte masking (I hate java's signed bytes...) becomes something more like:
|| (((in[ref] & 0xFF) << 8) | (in[ref+1] & 0xFF)) != ((hash >> 8) & 0xffff)) {
which unfortunately is bit slower on my tests...
from compress.
You are right, in my code I also have "& 255" I wonder why I forgot it here.
I guess the reason why it is a bit faster on my machine is that I have different test data.
from compress.
Ok. Which test file(s) did you use? I have simplest of tests under src/test/java/perf/ManualPerfComparison.java which I used on just one of compression files.
from compress.
I used the data I need to compress in my case, which is database page data (from the H2 database).
I guess it would be better to optimize performance for a more common mix of data, for example the test data benchmarks: http://github.com/ning/jvm-compressor-benchmark/wiki
from compress.
Yeah I use test data from that test benchmark. Actually if you know of additional data sets I could also those to jvm-compressor-becnhmark. I do believe that there may be improvements to do for compress side, for what that's worth, just need to figure out good ordering for test etc.
But I also need to occasionally compare performance between versions; I did this to check how 0.7 and 0.8.5 compare (and determine there's 10-15% improvement for uncompress).
from compress.
Related Issues (20)
- Implement skip() efficiently, without needing to decode if possible HOT 1
- Deserialize directly into a ByteBuffer HOT 6
- Add a method to encode directly into given output buffer (of guaranteed size) HOT 1
- Implement encoder (compressor) that makes use of sun.misc.Unsafe HOT 1
- Unsafe-based decompressor of 0.9.7 fails on 2 sample files from 'maxcomp' data set HOT 1
- Improve 'DataHandler` callback to allow early termination HOT 1
- Expose number of bytes read from `InputStream`, via `LZFInputStream` HOT 1
- Unsafe clean up of Thread Local Value
- Add new variants for "compress only if comp rate at least N" HOT 1
- Incorrect de-serialization leading to stream corruption in Big Endian systems HOT 9
- Add convenience method(s) for GZIP read/write
- Document parallel compression task
- OptimizedGZIPInputStream fails on chunked stream HOT 2
- estimateMaxWorkspaceSize() is too small HOT 9
- did not start with 'ZV' signature bytes HOT 5
- API changes report for Compress LZF
- Fix issues outlined by "lgtm.com"'s static analysis HOT 1
- Add Java 9+ module info using Moditect HOT 1
- `Unsafe` needs support in `module-info.java` HOT 1
- Mistaken Code in k8s HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compress.