Skip to content

Commit

Permalink
Disable perf test
Browse files Browse the repository at this point in the history
  • Loading branch information
kylecorry31 committed Jun 15, 2024
1 parent b0a139d commit 6e424f9
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ class FrequencyAnalysisTest {
assertEquals(expected.imaginary, actual.imaginary, tolerance)
}

@Test
fun fftPerformance(){
val data = List(1024) { sin(it.toFloat() / 1024f * 2 * Math.PI).toFloat() }
val runs = 100000
val twiddleFactors = FrequencyAnalysis.getTwiddleFactorsFFT(data.size)
val start = System.currentTimeMillis()
for (i in 0..runs){
FrequencyAnalysis.fft(data, twiddleFactors)
}
val end = System.currentTimeMillis()
val timePerRun = (end - start) / runs.toFloat()
println("FFT: ${end - start} ms, $timePerRun ms/run")
}
// @Test
// fun fftPerformance(){
// val data = List(1024) { sin(it.toFloat() / 1024f * 2 * Math.PI).toFloat() }
// val runs = 100000
// val twiddleFactors = FrequencyAnalysis.getTwiddleFactorsFFT(data.size)
// val start = System.currentTimeMillis()
// for (i in 0..runs){
// FrequencyAnalysis.fft(data, twiddleFactors)
// }
// val end = System.currentTimeMillis()
// val timePerRun = (end - start) / runs.toFloat()
// println("FFT: ${end - start} ms, $timePerRun ms/run")
// }
}

0 comments on commit 6e424f9

Please sign in to comment.