Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 6 additions & 28 deletions app/src/main/java/app/gamenative/service/SteamService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ import app.gamenative.statsgen.Achievement
import app.gamenative.statsgen.StatType
import app.gamenative.statsgen.StatsAchievementsGenerator
import app.gamenative.statsgen.VdfParser
import app.gamenative.utils.DownloadSpeedConfig
import java.nio.ByteBuffer
import java.nio.ByteOrder

Expand Down Expand Up @@ -1657,34 +1658,11 @@ class SteamService : Service(), IChallengeUrlChanged {
return@launch
}

// Some notes here:
// Write should always be 1 in mobile device, as normally it does not use a SSD for storage
// And to have maximum throughput, set downloadRatio = decompressRatio = 1.0 x CPU Cores
var downloadRatio = 0.0
var decompressRatio = 0.0

when (PrefManager.downloadSpeed) {
8 -> {
downloadRatio = 0.6
decompressRatio = 0.2
}
16 -> {
downloadRatio = 1.2
decompressRatio = 0.4
}
24 -> {
downloadRatio = 1.5
decompressRatio = 0.5
}
32 -> {
downloadRatio = 2.4
decompressRatio = 0.8
}
}

val cpuCores = Runtime.getRuntime().availableProcessors()
val maxDownloads = (cpuCores * downloadRatio).toInt().coerceAtLeast(1)
val maxDecompress = (cpuCores * decompressRatio).toInt().coerceAtLeast(1)
// Moved to DownloadSpeedConfig
val speedConfig = DownloadSpeedConfig()
val cpuCores = speedConfig.cpuCores
val maxDownloads = speedConfig.maxDownloads
val maxDecompress = speedConfig.maxDecompress

Timber.i("CPU Cores: $cpuCores")
Timber.i("maxDownloads: $maxDownloads")
Expand Down
Loading
Loading