integrate: Jafama + KMath #357

Merged
therealansh merged 7 commits from kmathJafama into dev 2021-06-12 10:25:25 +03:00
therealansh commented 2021-06-02 22:49:30 +03:00 (Migrated from github.com)

This PR resolves #176.

This PR resolves #176.
CommanderTvis (Migrated from github.com) requested changes 2021-06-02 22:57:39 +03:00
CommanderTvis (Migrated from github.com) reviewed 2021-06-02 22:59:11 +03:00
CommanderTvis (Migrated from github.com) reviewed 2021-06-02 23:01:18 +03:00
CommanderTvis (Migrated from github.com) reviewed 2021-06-03 00:43:42 +03:00
altavir commented 2021-06-03 08:39:03 +03:00 (Migrated from github.com)

I've rebased the fork since we do not do merges directly to the master. Please resolve conflicts.

I've rebased the fork since we do not do merges directly to the master. Please resolve conflicts.
altavir commented 2021-06-03 08:40:37 +03:00 (Migrated from github.com)

The module must be better documented (there should be a readme template). Also, there should be examples and a benchmark since the primary aim is performance.

The module must be better documented (there should be a readme template). Also, there should be examples and a benchmark since the primary aim is performance.
therealansh commented 2021-06-03 20:52:52 +03:00 (Migrated from github.com)

Hey @altavir @CommanderTvis
While running Benchmarks i am running into this problem

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.openjdk.jmh.util.Utils (file:/Users/anshtyagi/.gradle/caches/modules-2/files-2.1/org.openjdk.jmh/jmh-core/1.21/442447101f63074c61063858033fbfde8a076873/jmh-core-1.21.jar) to field java.io.PrintStream.charOut
WARNING: Please consider reporting this to the maintainers of org.openjdk.jmh.util.Utils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" java.lang.RuntimeException: ERROR: Unable to find the resource: /META-INF/BenchmarkList
	at org.openjdk.jmh.runner.AbstractResourceReader.getReaders(AbstractResourceReader.java:98)
	at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:122)
	at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:263)
	at org.openjdk.jmh.runner.Runner.run(Runner.java:209)
	at org.openjdk.jmh.Main.main(Main.java:71)

Process finished with exit code 1

Any workaround to test benchmarks?

Hey @altavir @CommanderTvis While running Benchmarks i am running into this problem ``` WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.openjdk.jmh.util.Utils (file:/Users/anshtyagi/.gradle/caches/modules-2/files-2.1/org.openjdk.jmh/jmh-core/1.21/442447101f63074c61063858033fbfde8a076873/jmh-core-1.21.jar) to field java.io.PrintStream.charOut WARNING: Please consider reporting this to the maintainers of org.openjdk.jmh.util.Utils WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Exception in thread "main" java.lang.RuntimeException: ERROR: Unable to find the resource: /META-INF/BenchmarkList at org.openjdk.jmh.runner.AbstractResourceReader.getReaders(AbstractResourceReader.java:98) at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:122) at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:263) at org.openjdk.jmh.runner.Runner.run(Runner.java:209) at org.openjdk.jmh.Main.main(Main.java:71) Process finished with exit code 1 ``` Any workaround to test benchmarks?
CommanderTvis commented 2021-06-03 21:23:50 +03:00 (Migrated from github.com)

Use JDK 11. @therealansh

Use JDK 11. @therealansh
therealansh commented 2021-06-04 07:58:59 +03:00 (Migrated from github.com)

Use JDK 11. @therealansh

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.openjdk.jmh.util.Utils (file:/Users/anshtyagi/.gradle/caches/modules-2/files-2.1/org.openjdk.jmh/jmh-core/1.21/442447101f63074c61063858033fbfde8a076873/jmh-core-1.21.jar) to field java.io.PrintStream.charOut

The issue does not seem to be resolved even after using JDK 11. I am using IntelliJ as IDE and have set the JDK to be 11

> Use JDK 11. @therealansh ``` WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.openjdk.jmh.util.Utils (file:/Users/anshtyagi/.gradle/caches/modules-2/files-2.1/org.openjdk.jmh/jmh-core/1.21/442447101f63074c61063858033fbfde8a076873/jmh-core-1.21.jar) to field java.io.PrintStream.charOut ``` The issue does not seem to be resolved even after using JDK 11. I am using IntelliJ as IDE and have set the JDK to be 11
CommanderTvis commented 2021-06-04 20:22:14 +03:00 (Migrated from github.com)

Use JDK 11. @therealansh

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.openjdk.jmh.util.Utils (file:/Users/anshtyagi/.gradle/caches/modules-2/files-2.1/org.openjdk.jmh/jmh-core/1.21/442447101f63074c61063858033fbfde8a076873/jmh-core-1.21.jar) to field java.io.PrintStream.charOut

The issue does not seem to be resolved even after using JDK 11. I am using IntelliJ as IDE and have set the JDK to be 11

Now it's a warning, and it's an issue to JMH and kotlinx-benchmark, which is already reported AFAIK.

> > Use JDK 11. @therealansh > > ``` > WARNING: An illegal reflective access operation has occurred > WARNING: Illegal reflective access by org.openjdk.jmh.util.Utils (file:/Users/anshtyagi/.gradle/caches/modules-2/files-2.1/org.openjdk.jmh/jmh-core/1.21/442447101f63074c61063858033fbfde8a076873/jmh-core-1.21.jar) to field java.io.PrintStream.charOut > ``` > > The issue does not seem to be resolved even after using JDK 11. I am using IntelliJ as IDE and have set the JDK to be 11 Now it's a warning, and it's an issue to JMH and kotlinx-benchmark, which is already reported AFAIK.
CommanderTvis commented 2021-06-05 18:35:26 +03:00 (Migrated from github.com)

@therealansh There are still some conflicts.

@therealansh There are still some conflicts.
altavir (Migrated from github.com) requested changes 2021-06-06 09:20:57 +03:00
altavir (Migrated from github.com) left a comment

Benchmark and their results in README are still missing.

Benchmark and their results in README are still missing.
therealansh (Migrated from github.com) reviewed 2021-06-06 15:34:42 +03:00
therealansh commented 2021-06-06 15:36:08 +03:00 (Migrated from github.com)

Benchmark and their results in README are still missing.

As i stated the benchmarks written does not run due to the warning and thus does not produce any results. I'll be finding a work around for it.

> Benchmark and their results in README are still missing. As i stated the benchmarks written does not run due to the warning and thus does not produce any results. I'll be finding a work around for it.
altavir (Migrated from github.com) reviewed 2021-06-06 15:38:17 +03:00
altavir commented 2021-06-06 15:39:24 +03:00 (Migrated from github.com)

@therealansh The warning is completely harmless. It should work perfectly fine with it. So your problem is with something else. Try looking into the benchmarks subproject and just replicate what happens there.

@therealansh The warning is completely harmless. It should work perfectly fine with it. So your problem is with something else. Try looking into the `benchmarks` subproject and just replicate what happens there.
altavir commented 2021-06-07 19:46:22 +03:00 (Migrated from github.com)

Still no benchmarcs.

Still no benchmarcs.
therealansh commented 2021-06-08 07:12:29 +03:00 (Migrated from github.com)

Still no benchmarcs.

The issue is still persistant. The resource file META_INF/BenchmarksList seems to be missing and i have tried the solutions but nothing seems to work

> Still no benchmarcs. The issue is still persistant. The resource file META_INF/BenchmarksList seems to be missing and i have tried the solutions but nothing seems to work
altavir commented 2021-06-08 08:14:10 +03:00 (Migrated from github.com)

I am not sure how do you try to add benchmarks, but the ones here are obviously working. You just need to add a dependency on module a appropriate benchmark suite.

I am not sure how do you try to add benchmarks, but the ones [here](https://github.com/mipt-npm/kmath/tree/dev/benchmarks) are obviously working. You just need to add a dependency on module a appropriate benchmark suite.
therealansh commented 2021-06-08 08:58:11 +03:00 (Migrated from github.com)

I am not sure how do you try to add benchmarks, but the ones here are obviously working. You just need to add a dependency on module a appropriate benchmark suite.

I am trying to run these with JMH but i guess there is an issue with JMH and Kotlin.

> I am not sure how do you try to add benchmarks, but the ones [here](https://github.com/mipt-npm/kmath/tree/dev/benchmarks) are obviously working. You just need to add a dependency on module a appropriate benchmark suite. I am trying to run these with JMH but i guess there is an issue with JMH and Kotlin.
altavir commented 2021-06-08 10:28:39 +03:00 (Migrated from github.com)

Are you saying that gradle benchmark task is failing? If it is, please create an issue with the description of the problem. The warning you described earlier is not the case of the problem.

Are you saying that `gradle benchmark` task is failing? If it is, please create an [issue](https://github.com/mipt-npm/kmath/issues) with the description of the problem. The warning you described earlier is not the case of the problem.
therealansh commented 2021-06-08 11:09:31 +03:00 (Migrated from github.com)

@altavir i guess the issue is related to this plugin i guess https://github.com/artyushov/idea-jmh-plugin/issues/22

@altavir i guess the issue is related to this plugin i guess https://github.com/artyushov/idea-jmh-plugin/issues/22
altavir commented 2021-06-08 11:24:02 +03:00 (Migrated from github.com)

Nobody talked about idea plugin. Just run benchmarks from gradle. Please see how it is done for other benchmarks.

Nobody talked about idea plugin. Just run benchmarks from gradle. Please see how it is done for other benchmarks.
therealansh commented 2021-06-08 11:54:44 +03:00 (Migrated from github.com)

Nobody talked about idea plugin. Just run benchmarks from gradle. Please see how it is done for other benchmarks.

I did the run the gradle and build the benchmarks but how can i see the results of the benchmarks?

> Nobody talked about idea plugin. Just run benchmarks from gradle. Please see how it is done for other benchmarks. I did the run the gradle and build the benchmarks but how can i see the results of the benchmarks?
altavir commented 2021-06-08 11:58:48 +03:00 (Migrated from github.com)

In the terminal. Additional documentation is available in the plugin repository.

In the terminal. Additional documentation is available in [the plugin repository](https://github.com/Kotlin/kotlinx-benchmark).
therealansh commented 2021-06-08 13:14:02 +03:00 (Migrated from github.com)

On running gradle benchmarks it just build but doesnt show any benchmarks of the any of the pre-built benchmark classes (BigIntBenchmark, ArrayBrnchmark and so on) do i have to run any other command as well?

On running gradle benchmarks it just build but doesnt show any benchmarks of the any of the pre-built benchmark classes (BigIntBenchmark, ArrayBrnchmark and so on) do i have to run any other command as well?
altavir commented 2021-06-08 14:42:16 +03:00 (Migrated from github.com)

image

![image](https://user-images.githubusercontent.com/9514268/121178911-b6439080-c867-11eb-9139-b119f1466a4d.png)
therealansh commented 2021-06-08 16:52:35 +03:00 (Migrated from github.com)

Hey @altavir i added some benchmarks do i need to reflect in Readme as well?

Hey @altavir i added some benchmarks do i need to reflect in Readme as well?
altavir commented 2021-06-08 16:55:30 +03:00 (Migrated from github.com)

It would be nice to have the results. In the module readme.

It would be nice to have the results. In the module readme.
altavir commented 2021-06-11 09:51:38 +03:00 (Migrated from github.com)

@therealansh last two thigs before merge:

  • resolve conflicts
  • Add regular Kotlin.math operation to benchmarks for comparison.
@therealansh last two thigs before merge: * resolve conflicts * Add regular Kotlin.math operation to benchmarks for comparison.
therealansh commented 2021-06-12 07:33:29 +03:00 (Migrated from github.com)

@therealansh last two thigs before merge:

  • resolve conflicts
  • Add regular Kotlin.math operation to benchmarks for comparison.

Regarding the conflicts as i said should those basic arithmetic functions be removed? In my opinion they do not serve any purpose when we are comparing the libraries.

> @therealansh last two thigs before merge: > > - [ ] resolve conflicts > - [x] Add regular Kotlin.math operation to benchmarks for comparison. Regarding the conflicts as i said should those basic arithmetic functions be removed? In my opinion they do not serve any purpose when we are comparing the libraries.
altavir (Migrated from github.com) approved these changes 2021-06-12 10:25:10 +03:00
altavir commented 2021-06-12 10:26:34 +03:00 (Migrated from github.com)

The benchmark shows that the core kotlin math is actually faster than jafama. But we will merge it nonetheless because it is a good example of a new module.

The benchmark shows that the core kotlin math is actually faster than jafama. But we will merge it nonetheless because it is a good example of a new module.
therealansh commented 2021-06-12 11:14:35 +03:00 (Migrated from github.com)

Is it plausible that jafama might perform better on relatively smaller numbers?

Is it plausible that jafama might perform better on relatively smaller numbers?
Sign in to join this conversation.
No description provided.