-
Notifications
You must be signed in to change notification settings - Fork 4
Benchmarks
tenyr is not intended to be competitive in any particular way with existing architectures, but it is interesting to get an idea of where it sits with relation to existing architectures in terms of code density and perhaps other metrics. This page represents a collection of informal comparisons and "benchmarks" to relate tenyr to existing architectures.
Code density in instruction-count and/or byte/word-count is a potentially interesting metric. We would expect tenyr to have a relatively low code density (high instruction count) due to the rigorous simplicity of its design and the lack of special accommodations for common operations. A comparison of a few routines written in C and compiled with gcc -Os -fomit-frame-pointer
on Debian Linux on various architectures, with equivalent procedures written by hand in tenyr assembly, can be seen below.
The first function analysed is an original implementation of QSORT(3)
(C version, tenyr version), an unstable, in-place quicksort. As the function is not a leaf function (in fact, it is recursive), it must use more stack-related instructions to save state upon function calls than it would if it called no other functions. This may explain the high instruction count for tenyr code in this instance (176 instructions compared to an average around 137). Naturally this also results in a high size in bytes, although it is still beaten by IA64 due to the latter's larger average instruction size.
The second function analysed is an original implementation of BSEARCH(3)
(C version, tenyr version), a binary search algorithm. The implementation is iterative, and the only function called is the comparator function passed in as an argument. This may explain the relative competitiveness in instruction-count (51 instructions compared to an average of 46.3). Still, the only functions larger in size are rather esoteric 64-bit architectures, PA-RISC and IA64.
Note : the figures for BSEARCH(3) above are no longer accurate, since the C code has been corrected and optimised, and the tenyr code optimised. Rough numbers are (instructions,bytes) : i686=(32,76) ; x64=(38,93) ; tenyr=(40/160) ; others unknown.