Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Does Kotlin provide any performance boosts?
Is there any benchmarking?
Is Kotlin faster than Java?
I found this in the Kotlin website. https://kotlinlang.org/docs/reference/comparison-to-java.html
Talking about the language features but not performance.
Kotlin generates very similar bytecode to Java, so the performance of Kotlin code is in most cases the same as the performance of the equivalent Java code.
One way in which Kotlin can be faster than Java is inline functions. With inline functions, code using higher-order functions such as filter or map can be compiled to simple loop-based bytecode that doesn't create any objects or use any virtual calls (unlike Java code that uses the same type of functions).
Some benchmarks for Kotlin can be found here, here and here.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
Context: I am a novice to JVM and trying to build an app using Scala.
I was wondering, in mixed language projects (Scala/Java), for example Apache Spark, Apache Kafka, when do people choose to use Java to write a module where they already have been using Scala so far to write other modules, i.e. why those parts are not written in Scala itself?
Basically what are some example scenarios?
If for whatever reason you need to define a native java enum. Scala 2 has no syntax for defining them.
If you need an API that can be used by java programmers and you want to guarantee that not a single Scala specific feature or compilation artifact (mangled names, MODULE$ fields on objects ...) leaks out.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
What is the most efficient way of passing data from C++ to Java?
The Java application will need to call the C++ application to retrieve the data.
I can see the following ways of achieving this:
Using JNI
Using a file based approach
Using SWIG
My current thinking is to use JNI. AM I missing a better method before I commit?
Java Native Interface allows you to pass anything back and forth between C++ and Java. It supports both directions, but can be tricky. There are others you can look at Swig is one and then you have JNA. I would go with JNI
JNI would be the best approach. Notice that javah creates compatible header-files for your java-class, its very tricky to to write compatible header-files by your own, so please use javah.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
threads are not used, generics are not used.
Android uses only fraction of Java features, i know this, but what parts are NOT used?
p.s. this is not opinion type of question - i m asking about actual parts, i.e. specific answer, facts.
my opinion: threads are not used, generics are not used.
That's wrong. The whole java.util.concurrent package was ported up to java 1.6. And Generics are also full supported. What is not yet in, is the new java 1.8 features, like streams and lambda, and part of java 1.7, the new File.NIO 2
How about AWT and Swing? Android has it's own UI Framework.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
For genetic programming (how to use evolution to design software) I need a method to convert a string (generated by evolution) into Java 8 code. Please, help me.
Other example: For a GUI I have a field: enter your function, say y = x*x. It will be read as a string, how can convert it to code to next draw the graph of the function?
I would use a JAVA COMPATIBLE scripting language. Such as CLOJURE, JYTHON, JRUBY, GROOVY or JavaScript (via RHINO).
If you are particularly interested in using Java's syntax, then GROOVY should be the way to go.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I was wonderning efficiency of implemeting some Java EE APIs in Scala but not all of them. For instance JNDI would be faster in Scala because we can take advantage of supporting of high order function and so on.
I am interesting in which APIs implementation can be replaced for improve the effectiveness.
The logically correct answer is: no.
Both results run on the same JVM, so both implementations can be exactly the same in terms of processing efficiency. That Scala offers different language features doesn't change that.