mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 01:56:46 +02:00
Adds event factory performance test
This commit is contained in:
@@ -27,6 +27,8 @@ import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
||||
import com.vitorpamplona.quartz.crypto.CryptoUtils
|
||||
import com.vitorpamplona.quartz.encoders.Nip01Serializer
|
||||
import com.vitorpamplona.quartz.events.Event
|
||||
import com.vitorpamplona.quartz.events.EventFactory
|
||||
import com.vitorpamplona.quartz.utils.TimeUtils
|
||||
import junit.framework.TestCase.assertNotNull
|
||||
import junit.framework.TestCase.assertTrue
|
||||
import org.junit.Rule
|
||||
@@ -246,4 +248,13 @@ class EventBenchmark {
|
||||
serializer.escapeStringInto(specialEncoders, Nip01Serializer.BufferedDigestWriter(MessageDigest.getInstance("SHA-256")))
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun eventFactoryPerformanceTest() {
|
||||
val now = TimeUtils.now()
|
||||
val tags = arrayOf(arrayOf(""))
|
||||
benchmarkRule.measureRepeated {
|
||||
EventFactory.create("id", "pubkey", now, 1, tags, "content", "sig")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user