You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now we use abstract Template methods with various invoke/invokeVA methods. While this works, it incurs a performance drain for methods that use primitives in parameters or return type, or contain Object parameters that can be exposed to save unneeded casting.
Suggested solution: make Template.Class implementations abstract with abstract methods for all to-be-implemented methods. For example:
public static abstract class EntityClass extends Template.Class<EntityHandle> {
public final Template.Field.Double locX = new Template.Field.Double();
//etc.
public abstract int getTeleportTicks();
public abstract List<Entity> getPassengers();
public abstract void move(Object moveType, double dx, double dy, double dz);
}
The EntityClass will also include a 'RAW' constant somewhere to declare all raw, unconverted methods. For the raw class itself this variable will be assigned 'this'.
Instead of calling new on this class, it is extended and further implemented at runtime, then assigned to Template.T variable for later use by the Handle or elsewhere.
Ideally this will be implemented ON TOP of the current template system to avoid compatibility issues.
This has been improved by runtime-generating the handles. This means that using the Handle type (not the .T template elements) can have improved performance when invoking methods with primitive parameters or return types.
Right now we use abstract Template methods with various invoke/invokeVA methods. While this works, it incurs a performance drain for methods that use primitives in parameters or return type, or contain Object parameters that can be exposed to save unneeded casting.
Suggested solution: make Template.Class implementations abstract with abstract methods for all to-be-implemented methods. For example:
The EntityClass will also include a 'RAW' constant somewhere to declare all raw, unconverted methods. For the raw class itself this variable will be assigned 'this'.
Instead of calling new on this class, it is extended and further implemented at runtime, then assigned to Template.T variable for later use by the Handle or elsewhere.
Ideally this will be implemented ON TOP of the current template system to avoid compatibility issues.
Benefits:
Problems:
The text was updated successfully, but these errors were encountered: