Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sandjelkovic/stockanalysis
https://github.com/sandjelkovic/stockanalysis
Last synced: about 17 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/sandjelkovic/stockanalysis
- Owner: sandjelkovic
- Created: 2024-07-09T18:18:43.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2024-07-31T20:30:00.000Z (3 months ago)
- Last Synced: 2024-08-01T01:39:38.244Z (3 months ago)
- Language: Kotlin
- Size: 55.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Stock Analysis application
This is a simple application that provides near real time analysis of the stock prices previously saved to it. It is
used to demonstrate how Redis can be used for high performance and near real time data analysis.## Running the application
- Make sure port 8080 is not in use, and that you have installed JDK 17+ & Docker
- `docker compose up -d`
- `./gradlew bootRun`In case you're using IntelliJ or a tool that can read the http requests from the `http` file, you can use the requests
in the `httprequests` file to see the application working.## Running the tests
To run regular tests, you can use
- `./gradlew check`
To run performance benchmark tests on the calculations alone, you can use
- `./gradlew jmh`## Performance benchmarks
In order to deduce at what point it becomes more performant to use parallel processing instead of
sequential for calculations, there is a JMH benchmark test. The results are as follows:```
Benchmark (size) Mode Cnt Score Error Units
SequentialOrParallelBenchmarkTest.calculateSummaryParallel 10 avgt 4 0.024 ± 0.002 ms/op
SequentialOrParallelBenchmarkTest.calculateSummaryParallel 100 avgt 4 0.046 ± 0.006 ms/op
SequentialOrParallelBenchmarkTest.calculateSummaryParallel 1000 avgt 4 0.046 ± 0.019 ms/op
SequentialOrParallelBenchmarkTest.calculateSummaryParallel 10000 avgt 4 0.061 ± 0.020 ms/op
SequentialOrParallelBenchmarkTest.calculateSummaryParallel 100000 avgt 4 0.216 ± 0.085 ms/op
SequentialOrParallelBenchmarkTest.calculateSummaryParallel 1000000 avgt 4 1.607 ± 0.378 ms/op
SequentialOrParallelBenchmarkTest.calculateSummaryParallel 10000000 avgt 4 17.367 ± 10.681 ms/op
SequentialOrParallelBenchmarkTest.calculateSummarySequential 10 avgt 4 ≈ 10⁻⁴ ms/op
SequentialOrParallelBenchmarkTest.calculateSummarySequential 100 avgt 4 ≈ 10⁻³ ms/op
SequentialOrParallelBenchmarkTest.calculateSummarySequential 1000 avgt 4 0.010 ± 0.001 ms/op
SequentialOrParallelBenchmarkTest.calculateSummarySequential 10000 avgt 4 0.099 ± 0.023 ms/op
SequentialOrParallelBenchmarkTest.calculateSummarySequential 100000 avgt 4 1.116 ± 0.140 ms/op
SequentialOrParallelBenchmarkTest.calculateSummarySequential 1000000 avgt 4 14.272 ± 2.322 ms/op
SequentialOrParallelBenchmarkTest.calculateSummarySequential 10000000 avgt 4 120.417 ± 4.259 ms/op
```