bergerhealer / mountiplex Goto Github PK
View Code? Open in Web Editor NEWGeneral Purpose Java Reflection Library
License: MIT License
General Purpose Java Reflection Library
License: MIT License
Currently code sections are written out as-is and not generated at runtime. Requested is to add a way to compile these code sections at runtime, so that preprocessor declarations can operate on them. This will enable more efficient (less runtime checks) and compact code.
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.
Benefits:
Problems:
Right now it will default to using the standard Object get/set function, which will default to using Reflection for all primitive types. This incurs a performance overhead when copying objects, mainly during class interception/hooking.
Performance can be gained enabling the same invoke(a, b, c, d, e) method overloads for public static methods, like is already the case for public member methods.
The output conversion tree is used to chain up converters in optimal routes from all possible input types towards a given output type. The problem is that Input Converters mess this up a little, because they use Object as input type. As a result, I see cases where it lazy-converts and Object to a String and then feeds that into the input converter.
Input converters shouldn't at all be stored in the conversion tree. They should instead be queried for every new input type to populate new converters (getConverter()).
Ex:
class Chunk {
public final (Set[]) EntitySlice<Entity>[] entitySlices;
public (BlockData) IBlockData getBlockData((IntVector3) BlockPosition blockposition);
}
In this case, Mountiplex will place import java.util.Set[];
within ChunkHandler.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.