Posts

Showing posts from 2015

Some reviews of my JavaOne 2015 talks

Stephan Seigl reviewed my talks at JavaOne favourably here Has any one seen any other reviews of JavaOne? Cheers, Peter. ------------ Here are his reviews for my talks. Work with Hundreds of Hot Terabytes in JVMs (Peter Lawrey, Higher Frequency Trading and Per-Ake Minborg, Speedment) In this session Peter and Per-Ake showed nicely what benefits applications can achieve if they do not need to access the slow database for each request. Speedment basically allows to automatically read all data from a database to a memory cache and – this is interesting – provide a highly scalable approach to synchronize the data (Reactive persistent caching). Peter’s Chronicle Engine (mostly open source) allows to access this memory data is the most efficient way. This approach scales greatly. The examples they were showing had heap sizes in the range of tens of terabytes. Very nice talk. Presentation My Rating:  4/5 Legacy code and lambda (Peter Lawrey, Higher Freque...

My Bio

I often get asked for my Bio, so in case anyone is too shy to ask, here it is. My Bio - Most answers for Java and JVM on StackOverflow.com (11K+) - "Vanilla Java" blog with four million views and around 300 posts. - Founder of the  Performance Java User's Group , a virtual JUG with 1700+ members. - Architect of Chronicle Software , open source project for high performance, low latency libraries in Java. - Java Champion My LinkedIn page is  https://www.linkedin.com/in/peterlawrey Initial Services Over the last year, the most common way we engage a new client to conduct a one week workshop, even if you have been using Chronicle Software for a while this will be of benefit to you. Over the week the team develops the skeleton of a project of their choice and we look at how Chronicle Software products can help, and how to develop high performance code in Java in general. I am usually booked two months in advance, however we have other staff which can conduct t...

Common misconception: How many objects does this create?

Image
Overview A common question is how many objects or how many Strings does a section of code create. Often the answer is not what you think nor should you really need to know.  It is useful to have an idea of when an object is created but there is so many other factors which are often far more important to consider which can mean the total number for an application is not what you think. String is a not a single object A String wraps a char[].  This means that when you see a new String there could be a new char[] also involved. If you do + with a String it could use a StringBuilder (from Java 5.0) which also wraps a char[].  This means that usually there is more char[] created in Java than String objects. Sometimes char[] is the most common object type in a JVM. String literals are still Strings A common misconception is that String literals don't count.  They don't add to the total after the code has been run at least once, however most of the time the qu...

Low latency FIX engine in Java

Image
Overview Chronicle FIX is our Low Latency FIX engine and database for Java. What makes it different is that it; is designed for ultra low GC* in Java. supports Strings and date times in a way which minimises garbage and overhead. is customisable to include only the fields you expect. uses optimisations normally used in binary parsers and generators such as reading/writing 4 or 8 bytes at a time to improve efficiency. built on low latency persistence to minimise the latency of logging. is optimised for low latency network cards such as Solarflare. * Ultra low GC means it can produce less than a byte of garbage per message on average If you keep your total garbage rate to less than 1 GB per hour a 24 GB Eden can take all day to fill up and you don't get any minor GCs.  Produce less than 200 MB/hour and you can run for a week without a GC. But isn't Java slow? Java can be slower than C++ but written well Java can be faster than a C++ application not writte...

Custom operators for collections in Java

Overview Operator overloading is available in an number of languages.  Java has very limited operator overloading in it's support for the + operator for String types. We can draw on the different ways other languages support operators, however could we have an implementation in Java which uses conventions Java already uses. Get, set and put operations A common example of operator overloading for collections is using the array notation a[b] to access the collection itself.  When getting this is straight forward as both List and Map have a get method and this is consistent with the JavaBean getXxx() naming convention. List<String> text = ... String s = text[2]; // text.get(2); Map<String, MyType> map = ... MyType mt = map["Hello"]; // map.get("Hello") MyType mt = ... String xxx = ... String s = mt[xxx]; // mt.getXxx(); When it comes to setting a value based on an index or key, we have List.set(), Map.put() and setXxx() fr...

An introduction to optimising a hashing strategy

Overview The strategy that's used for hashing keys, can have a direct impact on the performance of a hashed collections such as a HashMap or HashSet. The built-in hashing functions are designed to be generic and work well in a wide range of use cases.  Can we do better, especially if you have a good idea of the use case? Testing a hashing strategy In a previous article I looked at a number of ways to test hashing strategies and in particular looked at a hashing strategy which had been optimised for "Orthogonal Bits" which looked at making sure each hash result was as different as possible based on just one bit changing. However, if you have a known set of elements/keys to hash you can optimise for that specific use case, rather trying to find a generic solution. Minimising Collisions One of the main things you want to avoid in a hashed collection is collisions.  This is when two or more keys map to the same bucket.  These collisions mean you have to do more ...

Chronicle Journal - Customizable Data Store

Overview The way to make any data structure or algorithm as fast as possible is for the code to do exactly what you want and no more.  The problem with building a data store which does everything anyone could want is that it won't do anything particularly well. What can you achieve with a custom data store in terms of performance? You can support; read/write latencies of around 75 nano-seconds. throughputs of 40 million operations per second. with binary encoding and compression reduce the size of your data by a factor of 100 or more. This saves memory and increases scalability. Control how replication utilises your network, or is synchronized with your database. Chronicle Map and Queue are very efficient, however if they don't do exactly what you need or they do more than you need this sort of collection has the potential to be much faster. Optimise the hash function for a known, fairly stable key set to minimise collision rate. Do we really need a customiz...

Half priced Gold support.

Half priced Gold support For the month of September 2015 we are offering Gold Support for half price. This includes Chronicle open source software. Core Java Development Any number of environments, server or client. Up to 2.5 days per month. Including ad hoc consulting and bespoke development. Email, JIRA or emergency phone support, 24/7, 2 hour response target. For the support and development alone, that's up to 30 days for as little as £700/day or $1100/day. If you would like to know more, please contact sales@chronicle.software

What does Chronicle Software do?

Image
Overview Chronicle Software is about simplifying fast data.  It is a suite of libraries to make it easier to write, monitor and tune data processing systems where performance and scalability are concerned. But its free, how do you make money, through support? We offer premium support . However, we often hear from users for the first time about a year after they have it in production.  Most users find they can support the software themselves.  It is only after a year or so, they have questions or concerns about where to take the product next.  In many cases, it is to a problem we have already solved and they just need to upgrade their software or use a new module we have added. As we don't know who is using most of our software, we can't advise them on how best to use our software and what updates or enhancements they would benefit from. We need users to contact us and ask questions.  We have a free forum , and we respond to 50% of questions in 2 hours...