Questions tagged [fastutil]

fastutil is a collection of type-specific Java classes that extend the Java Collections Framework by providing several containers, such as maps, sets, lists and prority queues, implementing the interfaces of the java.util package; it provides also big (64-bit) arrays, sets and lists, and fast, practical I/O classes for binary and text files.

From fastutil's GitHub README:

fastutil provides a huge collection of specialized classes generated starting from a parameterized version; the classes are much more compact and much faster than the general ones. Please read the package documentation for more information.

The compiled code is contained in the jar file, and should be installed where you keep Java extensions. Note that the jar file is huge, due to the large number of classes: if you plan to ship your own jar with some fastutil classes included, you should look at AutoJar or similar tools to extract automatically the necessary classes.

You have to "make sources" to get the actual Java sources; finally, "ant jar" and "ant javadoc" will generate the jar file and the API documentation.

The Java sources are generated using a C preprocessor. The gencsource.sh script reads in a driver file, that is, a Java source that uses some preprocessor-defined symbols and some conditional compilation, and produces a (fake) C source, which includes the driver code and some definitions that customize the environment.

24 questions
12
votes
1 answer

How to compare two datasets?

I am running a spark application that reads data from a few hive tables(IP addresses) and compares each element(IP address) in a dataset with all other elements(IP addresses) from the other datasets. The end result would be something…
Hemanth
  • 555
  • 1
  • 11
  • 28
8
votes
1 answer

Why is Integer parameter of Java method mapped to Int and not platform type?

Inspired by another question. In fastutil library there's IntArrayList class which has a method with the following Java signature: public void push(Integer o) From Kotlin it is seen as push(o: Int) Is there a specific reason why it is Int and not…
hotkey
  • 111,884
  • 27
  • 298
  • 285
4
votes
1 answer

How to convert map to biglist?

How to convert java.util.Map to fastutil.BigList? BigList empList= empMap.values().stream().collect(Collectors.toList());
praba
  • 1,064
  • 2
  • 17
  • 38
3
votes
0 answers

JRE Specification on if(m==c)m=c; and its significance

I have being seeing some weird codes of late. And i could not understand significance of their use. a if(m==c)m=c; does not make any sense until it is seen in a library such as fastutil and jhighlight. I have googled a lot on the subject but to my…
D. Sikilai
  • 350
  • 1
  • 2
  • 14
3
votes
1 answer

Integer set with continuous regions in Java

I would like to have int tree set implementation, which is optimized for sets with a lot of continuous regions. For example, such tree could know that is contains entire region from 100 to 150 and hence searching for 120 ends once this region…
Dims
  • 37,353
  • 77
  • 251
  • 478
2
votes
1 answer

Resources for understanding Fastutil internals

I'm looking for resources to understand how Java datatypes are implemented internally, and how libraries like Fastutil and Eclipse Collections provide faster implementations of the same. I tired looking through the codebases on Github…
2
votes
1 answer

Gradle files directory in Windows 10

After I pressed option 'Sync Project with Gradle Files' in Android Studio, where are these downloaded files (e.g. fastutil-7.2.0.jar) placed in Windows 10?
1
vote
1 answer

Need an optimised Map(k,v) e.g. (long, long[]), to avoid auto boxing

I have a piece of code which is basically as followed: long[] ids; long[][] values; The values are filled out of turn i.e. if ids = ['id1','id2',...] the values maybe be values = [['id2val1','id2val2',..]['id1val1','id2val2',...],..] The out of…
gourab ghosh
  • 124
  • 6
1
vote
2 answers

How do I combine fastutil maps in scala?

What's the quickest way to combine two Object2IntOpenHashMap[String] in scala? Looking to combine these two maps: val foo = new Object2IntOpenHashMap[String] foo.put("foo", 1) val bar = new Object2IntOpenHashMap[String] bar.put("foo", 1) …
John
  • 1,027
  • 1
  • 15
  • 29
1
vote
1 answer

Avoiding deprecation warning when using FastUtil IntList from Kotlin

FastUtil contains optimized collection implementations that avoid autoboxing overhead. To notify programmers of unintended autoboxing, for example when using IntList, they marked the Integer get(int) method as deprecated, suggesting to use int…
Jörn Horstmann
  • 31,936
  • 11
  • 65
  • 111
1
vote
2 answers

Preferred usage of ObjectArrayList over ArrayList

I am very new to Java. I have recently come across fastutil and found ObjectArrayList class. Is there any difference in performance if ObjectArrayList is used instead of ArrayList? What are the use cases for using ObjectArrayList?
abhijit
  • 305
  • 1
  • 3
  • 9
1
vote
0 answers

Profiled Java App - Why are map look-ups slow?

After profiling a Java application with JProfiler and YourKit, I've seen that multiple methods for accessing a Long to Object Map, we used fast util's map for high throughput, and arrays are slow. The application runs in a ticking environment, a…
1
vote
1 answer

How to achieve a thread-safe or immutable collection in fastutils?

Fastutil seems to be the fastest option for collections in Java. There are these javadocs: http://fastutil.di.unimi.it/docs/it/unimi/dsi/fastutil/longs/Long2ObjectMaps.SynchronizedMap.html but I have difficulty to find the usage example. How can I…
Askar Ibragimov
  • 6,494
  • 15
  • 65
  • 132
0
votes
1 answer

Best practice for iterating over fastutil primitive ArrayLists, e.g. IntArrayList?

What's best for read-iterating over an IntArrayList from the fastutil library in Java? fastutil is a library that is used for increased performance above what the standard library's collection classes and algorithms can do. So "best" in this…
Daniel S.
  • 5,811
  • 4
  • 28
  • 69
0
votes
1 answer

How to Install Fastutil using the .jar Executable file

I'm trying to install fastutil-8.2.2 library on my pc, however the .jar far I download does not execute. The downloaded file is of type executable jar. I have Java SE Runtime environment installed as well. How do I install this? If installation is…
1
2