diff --git a/benchmark/src/androidTest/java/com/vitorpamplona/quartz/benchmark/EventBenchmark.kt b/benchmark/src/androidTest/java/com/vitorpamplona/quartz/benchmark/EventBenchmark.kt index cf37a1141..2e96b6ab9 100644 --- a/benchmark/src/androidTest/java/com/vitorpamplona/quartz/benchmark/EventBenchmark.kt +++ b/benchmark/src/androidTest/java/com/vitorpamplona/quartz/benchmark/EventBenchmark.kt @@ -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") + } + } }