Skip to content

Power Digit Sum API and an Android App Implementation of the network API. This Public Fork of my CPS353 Coding Project at SUNY New Paltz(fall 25).

Notifications You must be signed in to change notification settings

poninka/PowerDigitSumAPI

 
 

Repository files navigation

Power Digit Sum Computation

API Diagram:

System Diagram

The api will use the sum of the digits of a number raised to a power. For example, for an input of 2^15 = 32768, the output would be 3 + 2 + 7 + 6 + 8 = 26.

Multi-threaded Network API

There is a multi-thread implementation of the Network API. Upper bound is set to 8. Uses "Executors.newFixedThreadPool(MAX_THREADS)" to limit threads.

Performance Tuning

Bottleneck: using Jconsole while running UserComputeSpeedIT showed high CPU usage this is due to PowerDigitSumController recomputed the same BigInteger power/digit sum every run.

Fix: Added PowerDigitSumControllerFast, which Cached successful results and looked them up in HashMap instead of recomputing.

Benchmark Results

Coordinator and Engine Time (ms)
Sequential (old) 19.8
Sequential + fast 0.4
Multi-threaded (old) 11.4
Multi-threaded + fast 1.2

Sequential improvement: 97.57%. Multithreaded improvement: 90.53%.

Used test/project/networkapi/UserComputeSpeedIT.java to determine results.

Android App

A companion Android app using gRPC to connect to the Power Digit Sum server.

App Screenshot

About

Power Digit Sum API and an Android App Implementation of the network API. This Public Fork of my CPS353 Coding Project at SUNY New Paltz(fall 25).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 89.9%
  • Kotlin 10.1%