Changes in / [7a054e82:b715c9a]


Ignore:
Location:
doc/generic_types/evaluation
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/Makefile

    r7a054e82 rb715c9a  
    5555
    5656run-c: c-bench
     57        @echo
    5758        @echo '## C ##'
    58         @./c-bench
    59         @printf 'source_size:\t%7d lines\n' `cat c-bench.c bench.h c-stack.h c-stack.c | wc -l`
    60         @printf 'binary_size:\t%7d bytes\n' `wc -c < c-bench`
     59        @/usr/bin/time -f 'max_memory:\t%M kilobytes' ./c-bench
     60        @printf 'source_size:\t%8d lines\n' `cat c-bench.c bench.h c-stack.h c-stack.c | wc -l`
     61        @printf 'binary_size:\t%8d bytes\n' `stat -c %s c-bench`
    6162
    6263run-cfa: cfa-bench
     64        @echo
    6365        @echo '## Cforall ##'
    64         @./cfa-bench
    65         @printf 'source_size:\t%7d lines\n' `cat cfa-bench.c bench.h cfa-stack.h cfa-stack.c | wc -l`
    66         @printf 'binary_size:\t%7d bytes\n' `wc -c < cfa-bench`
     66        @/usr/bin/time -f 'max_memory:\t %M kilobytes' ./cfa-bench
     67        @printf 'source_size:\t%8d lines\n' `cat cfa-bench.c bench.h cfa-stack.h cfa-stack.c | wc -l`
     68        @printf 'binary_size:\t%8d bytes\n' `stat -c %s cfa-bench`
    6769
    6870run-cpp: cpp-bench
     71        @echo
    6972        @echo '## C++ ##'
    70         @./cpp-bench
    71         @printf 'source_size:\t%7d lines\n' `cat cpp-bench.cpp bench.hpp cpp-stack.hpp | wc -l`
    72         @printf 'binary_size:\t%7d bytes\n' `wc -c < cpp-bench`
     73        @/usr/bin/time -f 'max_memory:\t %M kilobytes' ./cpp-bench
     74        @printf 'source_size:\t%8d lines\n' `cat cpp-bench.cpp bench.hpp cpp-stack.hpp | wc -l`
     75        @printf 'binary_size:\t%8d bytes\n' `stat -c %s cpp-bench`
    7376
    7477run-cppv: cpp-vbench
     78        @echo
    7579        @echo '## C++ virtual ##'
    76         @./cpp-vbench
    77         @printf 'source_size:\t%7d lines\n' `cat cpp-vbench.cpp bench.hpp object.hpp cpp-vstack.hpp cpp-vstack.cpp | wc -l`
    78         @printf 'binary_size:\t%7d bytes\n' `wc -c < cpp-vbench`
     80        @/usr/bin/time -f 'max_memory:\t%M kilobytes' ./cpp-vbench
     81        @printf 'source_size:\t%8d lines\n' `cat cpp-vbench.cpp bench.hpp object.hpp cpp-vstack.hpp cpp-vstack.cpp | wc -l`
     82        @printf 'binary_size:\t%8d bytes\n' `stat -c %s cpp-vbench`
    7983
    8084run: run-c run-cfa run-cpp run-cppv
  • doc/generic_types/evaluation/bench.h

    r7a054e82 rb715c9a  
    44#include <time.h>
    55
    6  #define N 100000000
    7  
     6#define N 100000000
    87
    98long ms_between(clock_t start, clock_t end) {
     
    1615        code \
    1716        _end = clock(); \
    18         printf("%s:\t%7ld ms\n", name, ms_between(_start, _end)); \
     17        printf("%s:\t%8ld ms\n", name, ms_between(_start, _end)); \
    1918}
    2019
  • doc/generic_types/evaluation/bench.hpp

    r7a054e82 rb715c9a  
    55#include <time.h>
    66
    7  #define N 100000000
    8  
     7static const int N = 100000000;
    98
    109long ms_between(clock_t start, clock_t end) {
     
    1716        code \
    1817        _end = clock(); \
    19         std::cout << name << ":\t" << std::setw(7) << ms_between(_start, _end) << std::setw(0) << " ms" << std::endl; \
     18        std::cout << name << ":\t" << std::setw(8) << ms_between(_start, _end) << std::setw(0) << " ms" << std::endl; \
    2019}
    2120
  • doc/generic_types/evaluation/cfa-stack.c

    r7a054e82 rb715c9a  
    5959        s->head = n->next;
    6060        T x = n->value;
    61         delete(n);
     61        ^n{};
     62        free(n);
    6263        return x;
    6364}
  • doc/generic_types/evaluation/cpp-vstack.cpp

    r7a054e82 rb715c9a  
    2525                delete crnt;
    2626        }
     27        head = nullptr;
    2728}
    2829
Note: See TracChangeset for help on using the changeset viewer.