Code Monkey home page Code Monkey logo

hayabaya's Introduction

Java/Scala Microbenchmark - hayabaya

For the purpose of learning Java as a beginner, Hayabaya was developed as a rudimentary Microbenchmark project. The code performs arithmetic operations (+,-,/,*) on arrays of type:

Integer ints[]
Float floats[]
Long longs[]
Float floats[]

And their primitive counterparts int[], long[], double[], float[]. The runtime for performing the arithmetic operations on the different types of arrays are measured.

Each of the operations are tested on all the datatypes for arrays of varying lenths as specified by a from, to, by expression, e.g, arrays of element lengths . 1,000 to 10,000 in steps of 1,000. In addition to the lenths, each element of the array is operated on a number of times called the CycleNumber which is defined just like the array length (from, to, by).

Hayabaya saves the results of the microbenchmark in CSV (Comma Separated Value) files with the following columns:

Example Hayabaya result output

Column name Name Datatype IsBoxed Operation ReplicationNumber ArrayLength CycleNumber Runtime
Description Name of the system/CPU Type of data tested logical, Integer= True (+,-,/,*) What replication is run Lenth of array Times operation is done on an element Runtime in ms
Example value Inteli7 Integer True ADD 4 100,000 10,000 230 (ms)
Example value AMDA4 int FALSE DIVIDE 5 100,000 20,000 175 (ms)

ToDo

  • Switch from Gradle build system to SBT build system
  • Use the "gen idea" plugin for SBT to generate the .idea folder and make a clean build
  • Re-design the Java domain model as a library provider for the Scala code being the "consumer"/"client" in the benchmark project.
  • Write Scala code using Java code to perform the benchmark
  • Implement code using the Scala version of the OpenJDK Java Microbenchmark Harness (JMH)

Design of Hayabaya

Use cases

Domain model

API

How to use

$ git clone [email protected]:slentzen/hayabaya.git
$ cd hayabaya
$ sbt gen-idea
$ sbt reload update compile
$ sbt run myTestRun small 4 # Run a predefined set named "small" with name "myTestRun" and 4 replicates

Clone or fork the repository. Then issue the "$sbt gen-idea" command to intialize an IntelliJ IDEA project definition.

Generate idea proj

Benchmark results

Conclusion

References

Contact

Legal matters

Referencing the project

hayabaya's People

Contributors

ktakagaki avatar

Watchers

 avatar

hayabaya's Issues

prune dead branches

Below I have shown the branches that I see when running git branch. To my knowledge, several of the branches are now no longer of any relevance and can be deleted, then I can run git prune to delete the dead references.

[cain@x51 hayabaya]$ (master) git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/TopicAugust05
  remotes/origin/caseclasses
  remotes/origin/dev
  remotes/origin/extra
  remotes/origin/kentaScala
  remotes/origin/kentatemp
  remotes/origin/master
  remotes/origin/meeting150522
  remotes/origin/simplifyLoopKenta
  remotes/origin/test190415
  remotes/origin/topic26
  remotes/upstream/TopicAugust05
  remotes/upstream/extra
  remotes/upstream/kentaScala
  remotes/upstream/kentaTestEnum160129
  remotes/upstream/kentatemp
  remotes/upstream/master
  remotes/upstream/meeting150522
  remotes/upstream/simplifyLoopKenta
  remotes/upstream/test190415
  remotes/upstream/topic26

Create SOP/Agree on standard procedure for colaborating

Agreee on a standard / And/or Standard Operating Procedure/Protocol for how to collaborate on GitHub.

New branches have been created on my Hayabaya repository which are preventing me from pushing own changes unless I do a Git rebase.

To avoid such future collissions, we should come up with a standard procedure for how we work together on each others repositories besides using pull requests.

We have already established our branching strategy as using the most commonly used topic branches and then do pull requests against another persons master branches. After target accepts the pull request, merges the changes into his branch the sender will fetch upstream and merge the new changes into his own branch. This is following the common way of doing things

Collaboration workflows are outlined here in the Git SCM Book

Now we just need to agree on a workflow for when working directly on another persons repository.

@ktakagaki

main function examples

@slentzen

The fork isn't reattached yet, so manually pull the branch
https://github.com/ktakagaki/hayabaya/tree/kentaScala
from your local repo.

I debugged your sbt file, it had

mainClass in (Compile, packageBin) := Some("de.lin_magdeburg.HayabayaMain")

instead of

mainClass in (Compile, packageBin) := Some("de.lin_magdeburg.hayabaya.HayabayaMain")

Run as follows in sbt:

>run hello 10

which will give

[info] Running de.lin_magdeburg.hayabaya.HayabayaMain hello 10
[info] [In Scala] Welcome to the Hayabaya Microbenchmark project
[info] The value of aTPE is: DOUBLE
[info] Hi Soren! Don't get too fancy with tuples, and parsing will be fine. Parsed: hello, 10
[success] Total time: 3 s, completed Jan 25, 2016 4:23:37 PM

try also

>run hello

and

>run hello hello2

to see error messages

Material on typeclasses in Scala

I'm looking for further reading material on Scala's type classes.
I've read Oderskys chapters on the topic, and the following video
https://www.youtube.com/watch?v=sVMES4RZF-8&feature=youtu.be

I am however not entirely sure what all of the applications of this feature is. The scala-lang.org website doesn't explicitly have any sections on typeclasses. What is another name for typeclasses, so I can Google for further information?

Hierachical tree structure for folders saving results

We discussed reordering the structure of the results folder when saving the results from Hayabaya. The intention was to enable running the experiment multiple times without risking any files being overwritten.

What organization do you prefer of the tree hierachy?

Suggestions: ( "/" denotes a new level of folders, "<", ">" used for meta-naming)
/ / / / -.csv

With
rootFolder = Results
CPU / System Name = Intel-i7
Experiment started running at 14:34 and 22 seconds on May the 15th = 05-15-14-34-22

Results/Intel-i7/05-15-14-34-22/Integer_Boxed/MULTIPLY_04.csv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.