3 comments

  • wood_spirit 46 minutes ago
    This is interesting. Java desperately needs an array of struct for type safe sugar over high performance arenas, but the areas you’d turn to this would be in a zero allocation effort where the cost of the this library’s off-heap and the object allocation in the getters and setters etc largely negate the advantages for a lot of use cases.
    • joe_mwangi 37 minutes ago
      Yup. Totally agree. Java does needs an array of structs. Hopefully value classes will help out through flattened array. But in future, one can use value records with this library with probable zero cost allocation. But the library doesn't use any reflection calls for get and set hence high performance as a result, and using records helps a lot with escape analysis. Planning to do some serious benchmarks soon. Some preliminary tests shows it's similar to c code (example code in test package). Performance suffers if record fields are arrays due to heap allocation of arrays.
      • PaulHoule 2 minutes ago
        The thing I coded where I felt the weight of the GC the most was a chess engine in Java that needed transposition tables. Like using regular HashMap(s) or anything similar it was too slow to really speed up the engine. If my son had stayed interested in chess I would have coded up an off-heap transposition tables but he switched to guitar which changed my side projects.
  • usernametaken29 12 minutes ago
    Why not use graal?
  • kosolam 40 minutes ago
    Nice. Very clean api.
    • joe_mwangi 34 minutes ago
      Thanks. Main goal. Unions is where I decided to pause - no simple and ergonomic way to do it at the moment.