1.16.5 Is using the JNI with C++ allowed?

Discussion in 'Spigot Plugin Development' started by Matteo_BR, Jun 13, 2021.

  1. I'm thinking of making a chat plugin that uses boost regex to improve performance. Can I post it here? (As source code or compiled?)
    • Like Like x 1
  2. I would say you can post both the compiled and source because open source is really awesome
  3. Optic_Fusion1

    Resource Staff

    How would it improve performance exactly compared to using java's regex features?
    • Agree Agree x 3
  4. I don't know. I briefly looked up some benchmarks and boost's regex seems faster. Also, native code is faster than java, so for other plugins it may give more performance. Is it allowed? If so, under what conditions?
  5. TheJavaHacker


    Native code? As in code that is native to the machine or native to the software you're building against?
    Because Minecraft Java Edition primarily only uses Java, therefore C++ will be a pain in the ass to get working.

    It's not... NOT against any rules, it's just harder to implement.
  6. I've heard that JNI calls are relatively slow. Anyhow, so long you precompile your regex, java's regex API is extremely fast, to use an alternative native implementation over it would be a micro optimization (assuming it offered any improvements at all).