chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] improve performance of write-u8vector


From: Thomas Hintz
Subject: [Chicken-hackers] [PATCH] improve performance of write-u8vector
Date: Mon, 20 Oct 2014 17:21:34 -0700

Improves performance of write-u8vector by copying the vector in one
chunk instead of writing it out character by character. I added range
checks too which seems like the right thing to do and is required if
either "from" or "to" are specified since that uses subu8vector now
which will fail if "from" or "to" is out-of-range. (Letting just
subu8vector do the range checks gives misleading error messages even
though it is redundant.) However, this will cause old code that passed
in invalid values to trigger an error now instead of just writing
nothing as is the current behavior. I added tests for write-u8vector as
well.

16MB test case, new:
0.06s CPU time, 0.04s GC time (major), 25/2 mutations (total/tracked),
3/4 GCs (major/minor)

old (4.9.0.1):
0.63s CPU time, 0.01s GC time (major), 25 mutations, 3/4886 GCs
(major/minor)


Thanks and all the best,
Thomas Hintz

Attachment: 0001-Improving-performance-of-write-u8vector.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]