Benchmarking Genode TrustZone
Tiago Brito
tb.genode at ...9...
Thu Jun 23 17:32:18 CEST 2016
I did not check if the binary code is similar, but I did measure just the
for-loop in both worlds and the times are those I described previously.
On the other hand, this code, which I used as test code before (previous
messages in this post) does have a similar execution time in both worlds:
void bench(int n) {
int buf[1024];
int i, j, k, r = 0;
for (i = 0; i < 1024; i++) {
buf[i] = 0;
}
for (j = 0; j < n; j++)
for (i = 0; i < 1024; i++)
for (k = 0; k < 1024; k++)
buf[i] = buf[i]+j+k;
for (i = 0; i < 1024; i++) {
r += buf[i];
}
PINF("Ended Bench %d - %d", (int)buf[0], r);
}
I tested this with n = 100000 and it showed an execution time of about 500
ms in both worlds.
2016-06-23 15:23 GMT+01:00 Christian Helmuth <
christian.helmuth at ...1...>:
> Hello Tiago,
>
> On Thu, Jun 23, 2016 at 02:40:10PM +0100, Tiago Brito wrote:
> > // start timer here
> > for(i = 0; i < size; i++) {
> > color = oldp[i];
> > alpha = (color >> 24) & 0xff;
> > red = (color >> 16) & 0xff;
> > green = (color >> 8) & 0xff;
> > blue = color & 0xff;
> > lum = (int) (red * 0.299 + green * 0.587 + blue * 0.114);
> > newp[i] = (alpha << 24) | (lum << 16) | (lum << 8) | lum;
> > }
> > // end timer here
> > // check timer diff and print result
> >
> > I'm testing this same exact code on both the Secure and Nonsecure
> domains.
> > In the NW I'm getting about 155 ms of execution time, which for that
> buffer
> > and transformation seems ok. On the other hand, the SW is giving me about
> > 610 ms of execution time.
> >
> > I can't seem to find a reasonable explanation for this time difference,
> > since the code running in both scenarios is exactly the same. The secure
> > code is running inside the TZ_VMM example.
>
> Did you check that the generated binary code is similar? Did you try
> to measure only the run time of the for-loop in both worlds?
>
> Regards
> --
> Christian Helmuth
> Genode Labs
>
> http://www.genode-labs.com/ · http://genode.org/
> https://twitter.com/GenodeLabs · /ˈdʒiː.nəʊd/
>
> Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
> Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
>
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> genode-main mailing list
> genode-main at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genode.org/pipermail/users/attachments/20160623/7b002165/attachment.html>
More information about the users
mailing list