Java provides many collection classes, such as arraylist and hashmap. But have you found that all these collection classes are generic, and sometimes you will find that using generic classes is slow. Where is the slowness? When it is slow, package installation and package splitting of the basic type will be slow. When you process a large amount of data, it is unacceptable when it is slow.
How can this be solved? We recommend that you use fastutil, which is produced by an Italian lab and mainly used on its webgraph.
The following is an introduction to the official website:
Fastutil extends the Java collections framework by providing type-specific maps, sets, lists and queues with a small memory footprint and fast access and insertion; provides also big (64-bit) arrays, sets and lists, and fast, practical I/O classes for binary and text files. it is free software distributed under the Apache license 2.0. it requires Java 6 or newer. the classes implement their standard counterpart interface (e.g ., map for maps) and can be plugged into existing code. moreover, they provide additional features (such as bidirectional iterators) that are not available in the standard classes. besides objects and primitive types, fastutil classes provide support for references, that is, objects that are compared using the equality operator rather than the equals () method. the sources are generated using a C Preprocessor, starting from a set of driver files. you can peek at thejavadoc-generated documentation. in particle, the overview explains the design choices used in fastutil.
I am currently writing many experiments on my own.CodeIn use, it is found that it is quite useful, and it is much better than the built-in JAVA, especially for basic types.