NaCl to host data transfer rate using PostMessage()

26 views
Skip to first unread message

Stefano Sabatini

unread,
Sep 28, 2015, 1:13:03 PM9/28/15
to Native-Client-Discuss
Hi,

I got some benchmark sending arraybuffer data from the NaCl plugin to the JS host, using this code:
 
   void SendData(void) {
        int i;
        pp::VarDictionary dictionary;
        pp::VarArrayBuffer data(1024*1024);
        dictionary.Set(pp::Var("type"), "data");
        dictionary.Set(pp::Var("data"), data);

        for (i = 0; i < 1000; i++) {
            fprintf(stderr, "Postdata\n");
            PostMessage(dictionary);
        }

        data.Unmap();

and I consistently get a total data transfer rate of 160 MiB/s.

Considering my use case (sending decompressed ARGB image from NaCl to JS), this corresponds to ~20fps for 1920x1080 video frames.

My question: is a value of 160 MiB/s expected when transferring data from NaCl to JS expected or is my benchmark flawed?

I can provide the complete benchmark application code if needed.

Thank you in advance.
Reply all
Reply to author
Forward
0 new messages