Changeset 38784 in project


Ignore:
Timestamp:
07/09/20 07:20:20 (4 weeks ago)
Author:
Kon Lovett
Message:

add memory-mapped-files/... deps, add time comparison

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/message-digest-utils

    r36737 r38784  
    496496the existing public API.
    497497
     498* Comparison - YMMV
     499
     500macOS 10.15.5 w/ 3.2 GHz 6-Core Intel Core i7
     501
     502csc MD-v-simple-results.scm -Dmd && ./MD-v-simple-results
     503=> MD = 90bbbcbab37cde02d31e2955f1ab9e17becab506
     504=> 1.966s CPU time, 220/205 mutations (total/tracked), 0/1 GCs (major/minor), maximum live heap: 369.73 KiB
     505
     506csc MD-v-simple-results.scm -Dsimple && ./MD-v-simple-results
     507=> Simple = 90bbbcbab37cde02d31e2955f1ab9e17becab506
     508=> 1.966s CPU time, 4316/20 mutations (total/tracked), 0/2 GCs (major/minor), maximum live heap: 328.68 KiB
     509
     510<enscript highlight=scheme>
     511(import scheme (chicken base) (chicken time) miscmacros)
     512
     513;11MB File
     514(define-constant TEST-FILE "The Periodic Table of Irrational Nonsense.jpg")
     515(define-constant REPS 100)
     516
     517(cond-expand
     518  (simple
     519    (import simple-sha1)
     520    (define source "Simple")
     521    (define-syntax digest
     522      (syntax-rules ()
     523        ((digest ?fl)
     524          (sha1sum ?fl)) ) ))
     525  (md
     526    (import sha1 message-digest-item)
     527    (define source "MD")
     528    (define-syntax digest
     529      (syntax-rules ()
     530        ((digest ?fl)
     531          (let ((sha1 (sha1-primitive))) (message-digest-file sha1 ?fl)) ) ) ) ) )
     532
     533(print source " = " (digest TEST-FILE))
     534(time (repeat REPS (digest TEST-FILE)))
     535</enscript>
     536
    498537
    499538== Requirements
     
    502541[[blob-utils]]
    503542[[string-utils]]
     543[[memory-mapped-files]]
     544[[message-digest-primitive]]
     545[[message-digest-type]]
    504546
    505547
Note: See TracChangeset for help on using the changeset viewer.