As a rule, the solution should not be one of the fastest - Python classes will be implemented in terms of Java classes in any case, even if they do not inherit from them. Thus, the speed should be approximately comparable, and, at most, you would save a couple of method calls per operation.
The bigger question is what you plan to do with your class. If you use it with the Python APIs, you'll want to use Python types or something that behaves like them, so you don't have to do the work of implementing the entire matching protocol (only the bits of your class are changed). If you use Java APIs, you definitely need to perform static type checks, which means you need to inherit Java classes.
If it’s not easy for you to answer in your situation, start with Python, as you (correctly ;-) will find them “simpler and sexier”. If your class does not go beyond your project, then it should be trivial to change later, if speed really becomes a problem - and at this point you can also think about issues such as “can this help to implement it” completely at the level Java? "which we hopefully find out will be premature optimization to think about it now.
source share