Started using direct ByteBuffers for our performance tests (#83371)

This commit is contained in:
gaaclarke
2021-06-02 13:50:58 -07:00
committed by GitHub
parent 3bb4a34a0b
commit 72725643be

View File

@@ -23,7 +23,7 @@ class MainActivity: FlutterActivity() {
} }
val basicStandard = BasicMessageChannel(flutterEngine.dartExecutor, "dev.flutter.echo.basic.standard", StandardMessageCodec.INSTANCE)
basicStandard.setMessageHandler { message, reply -> reply.reply(message) }
val basicBinary = BasicMessageChannel(flutterEngine.dartExecutor, "dev.flutter.echo.basic.binary", BinaryCodec.INSTANCE)
val basicBinary = BasicMessageChannel(flutterEngine.dartExecutor, "dev.flutter.echo.basic.binary", BinaryCodec.INSTANCE_DIRECT)
basicBinary.setMessageHandler { message, reply -> run {
if (byteBufferCache == null) {
byteBufferCache = ByteBuffer.allocateDirect(message!!.capacity())