0
I Use This!
Activity Not Available

Project Summary

Fast Reflectionjava refleciton api 可以让程序变得灵活,但是速度影响很大,fast Refleciton 可以解决这个问题

速度Fast Reflction 在我的测试中所花的时间大约是javaReflection所花时间的10%-20%

用法public static void main(String args[])
{
try
{
int N = 100000000;
FastReflect fr = new FastReflect();
Method m = TestClass.class.getMethod("setAaa",
new Class[] { int.class });
FastMethod fm = fr.getFastMethod(m);
TestClass test = new TestClass();
long start = System.currentTimeMillis();
for (int i = 0; i < N; i++)
{
m.invoke(test, 1);
}
long reflectTime = System.currentTimeMillis() - start;
start = System.currentTimeMillis();
for (int i = 0; i < N; i++)
{
fm.invoke(test, 1);
}
long fastReflectTime = System.currentTimeMillis() - start;
System.out.println("Reflect:" + reflectTime);
System.out.println("fastReflect:" + fastReflectTime);
} catch (Exception e)
{
e.printStackTrace();
}
}

public static class TestClass
{
private int aaa;

/**
* @return the aaa
*/
public int getAaa()
{
return aaa;
}

/**
* @param aaa
* the aaa to set
*/
public void setAaa(int aaa)
{
this.aaa = aaa;
}

}

Tags

asm bytecode fastreflection java pxb reflection replacement

In a Nutshell, fast-reflection...

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

Apache License 2.0
Permitted

Commercial Use

Modify

Distribute

Place Warranty

Sub-License

Private Use

Use Patent Claims

Forbidden

Hold Liable

Use Trademarks

Required

Include Copyright

State Changes

Include License

Include Notice

These details are provided for information only. No information here is legal advice and should not be used as such.

This Project has No vulnerabilities Reported Against it

Did You Know...

  • ...
    there are over 3,000 projects on the Open Hub with security vulnerabilities reported against them
  • ...
    by exploring contributors within projects, you can view details on every commit they have made to that project
  • ...
    in 2016, 47% of companies did not have formal process in place to track OS code
  • ...
    learn about Open Hub updates and features on the Open Hub blog

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

Community Rating

Be the first to rate this project
Click to add your rating
  
Review this Project!