Skip to content
Advertisement

Tag: performance

What does “Other” mean in Java GC log?

I have such setup Java 11 Corretto inside Docker running on EC2 Java options: -Xms1200m -Xmx1200m -XX:+UseG1GC -Xlog:gc* In log I see that usually GC takes ~100-200ms, but for some timeslots, I see some weird behavior: [2074.114s][info][gc,phases ] GC(39) Other: 4082.5ms What does this “other” step mean? Answer This is most likely due to time spent writing the log out

In Java, how to copy data from String to char[]/byte[] efficiently?

I need to copy many big and different String strs’ content to a static char array and use the array frequently in a efficiency-demanding job, thus it’s important to avoid allocating too much new space. For the reason above, str.toCharArray() was banned, since it allocates space for every String. As we all know, charAt(i) is more slowly and more complex

short -> int -> long type promotion: is there any overhead?

If, for example, I define method’s return type/parameter as char, but both the caller and implementation actually immediately use it as an int, is there any overhead? If I understand correctly, the values on the stack are 32-bits aligned anyway, as are the ‘registers’ (I’m sorry, I’m not well versed in the byte code). A word of explanation: I am

Profiling Java code changes execution times

I’m trying to optimize my code, but it’s giving me problems. I’ve got this list of objects: There is 1700 objects with unique id (0-1699) and some name, it’s used to decode what type of data I get later on. The method that I try to optimize works like that: This method is called about milion times when processing data

Sandboxed java scripting replacement for Nashorn

I’ve been using Nashorn for awk-like bulk data processing. The idea is, that there’s a lot of incoming data, coming row by row, one by another. And each row consists of named fields. These data are processed by user-defined scripts stored somewhere externally and editable by users. Scripts are simple, like if( c>10) a=b+3, where a, b and c are

Count the semiprime numbers in the given range [a..b]

I am solving Codility problem CountSemiprimes: Count the semiprime numbers in the given range [a..b]. Task description A prime is a positive integer X that has exactly two distinct divisors: 1 and X. The first few prime integers are 2, 3, 5, 7, 11 and 13. A semiprime is a natural number that is the product of two (not necessarily

Advertisement