Skip to content

Tag: performance

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 …

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…