Projects tigase _server tigase-utils Issues #23
Improve class loading performance (#23)
Closed
wojciech.kapcia@tigase.net opened 4 years ago

Perform class loading and filtering in parallel (stream comes to mind) should speed up the process, possible candidates:

  • tigase-utils:
    • tigase.util.ClassUtil#getClassesFromNames(java.util.Set<java.lang.String>, java.util.function.Predicate<java.lang.String>)
    • tigase.util.ClassUtil#getClassesFromClassPath(java.util.function.Predicate<java.lang.String>)
  • tigase-server:
    • tigase.kernel.beans.config.AbstractBeanConfigurator#getBeanClassesFromAnnotations
    • places where tigase.util.reflection.ClassUtilBean#getAllClasses() is used and looped

It may be a good idea to use JMH (vide https://github.com/tigase/tigase-jmh-benchmarks)

wojciech.kapcia@tigase.net commented 4 years ago

@andrzej.wojcik I toyed with it a bit and:

  • getClassesFromNames - this one short-cirquites and it's quite fast
  • getClassesFromClassPath - this one finishes in ~75ms (and my quick attempt at parallel stream bumped it 10x)
  • getBeanClassesFromAnnotations in general finishes in 0ms

Not sure if there is any room to improvements here and #server-1210 would give more benefits.

Andrzej Wójcik (Tigase) commented 4 years ago

@wojtek I suppose that this may be slow when you do not have an SSD. Have you checked on AWS-EC2? I suppose it could be slower, but with your measures I should not have a huge impact.

I suppose we could skip this task. If you agree, then please close it.

wojciech.kapcia@tigase.net commented 4 years ago

No, I haven't checked on AWS, but it should have minimal impact there.

issue 1 of 1
Type
Task
Priority
Normal
Assignee
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/tigase-utils#23
Please wait...
Page is in error, reload to recover