vinothchandar commented on pull request #1760:
URL: https://github.com/apache/hudi/pull/1760#issuecomment-685864029
May not work actually
```
class A {
def doSomething(arg: Int) = {
}
}
@Test def testReflectionPerformance(): Unit = {
// warmup the jvm and ignore.
val a = new A()
(1 to 100000000).foreach(_ => a.doSomething(1))
val normalStartMs = System.currentTimeMillis();
(1 to 100000000).foreach(_ => a.doSomething(1))
println(s"Normal elapsed : ${System.currentTimeMillis() -
normalStartMs}")
val reflectStartMs = System.currentTimeMillis();
val method = a.getClass.getMethods.filter(method =>
method.getName.equals("doSomething")).last
(1 to 100000000).foreach(_ => method.invoke(a, 1.asInstanceOf[Object]))
println(s"Reflect elapsed : ${System.currentTimeMillis() -
reflectStartMs}")
}
```
gives the following results
```
Normal elapsed : 30
Reflect elapsed : 312
```
let's abandon the reflection approach altogether. Either we munge the APIs
somehow or just make a separate module for spark3 . e.g `hudi-spark3` with its
own bundling. This may not be a bad choice per se. wdyt
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]