Ride to Lake Samish

Liam and I had a good ride to Lake Samish. We started rather late so after we got to the county Park and ate lunch….it was almost 3pm, so we just backtracked up Old Samish Rd. We realized it took us about 2h to climb up though Samish his and about 6 Mon to descend them. The cloud shapes in the hills were magnificent.  I repeatedly remarked on how grateful I was for finally getting to climb that route on my bike,  and

image

more so with my Liam.

image

image

image

And the dirt of those miles makes me happy. 

Padilla Bay at the end of 2014

This is one of the few times I have tried an HDR process with Hugin and Luminance HDR. Please tell me what you do not like about it, curious if it matches what I don’t like about it. I did go in an chew on it with Gimp for a bit, I wanted the sky and ground a bit darker at different levels. I’m clearly faster at it using Gimp.

Padilla Bay

Padilla Bay

Brooks saddle

I completely wore out my old wtb saddle which had been with me for about three bicycles.  Now,  with a longer commute, I figured I could easily break in a Brooks. I’ve gone about 60 miles on it with 25 of them in torrential rain.  The instructions on Brooks website suggest stretching the saddle every six months.

The way it presently sits isn’t particularly comfortable.  I slide down to the center of the. Saddle and also keep pushing. Myself back to the rivets where the saddle doesn’t try to rub my perineum.  It’s this a common experience? I’m also tempted to tip the nose of the saddle higher so I don’t slide forward as much. You can clearly see the nose is really high already.  Was very tempted to bend the dang thing into a different shape but I calmed down after that grouchy ride. Advice?

 

image

image

image

image

Profiling Perl

Often we write perl scripts that loop a particular action. Not so often we write a perl script that is called in a loop by another tool. My script was attempting to do a http web login to emulate user traffic. However, I was not able to start more than 8 of these scripts a second.

Timing the script inside of perl was actually almost useless. Often you have a profiling marker like:

use Time::HiRes::time;
my $start = time;
# stuff
print "delta: ".(time - $start)."\n";

And that was just telling me I spent 4ms doing my stuff. And so where the heck did the other 108ms occur?

Here was another trick I started using to estimate latency: passing in the start time from the command line:

$ ./script.pl --invoked `date +%s.%4N`

and I would parse it in the script:
my $start;

GetOptions(
   "invoked=f" => \$start,
);
# stuff
print "delta: ".(time - $start)."\n";

Ah…there was my 114ms latency again. So startup of the script must be eating up ~100ms. Well, what could I remove? Anything I did not need to use obviously. Let’s comment out my strictitudinal use statements:

#use strict;
#use warnings;
#use diagnostics;
#use Carp;
#$SIG{ __DIE__ } = sub { Carp::confess( @_ ) };

Wow, I just gained 40ms! But can’t I do better than that? Ah hah, time to use a profiler. After a bit of research, I installed the NYTProf package.

I found some surprising slowdown spots:

  • Time::HiRes – took up to 10ms to load, using `date` takes about 300 microseconds
  • GetOpt::Long – pretty long load time, with a lot of dependencies, what I have now to parse ARGV is not as flexible, but it takes no time to start up.
  • use constant – took up to 45ms to load, about 20ms of that was loading utf8_heavy.ph. Apparently it takes a lot of work to allow any utf8 character to be a legal script constant? Didn’t need it.
  • including ‘use strict’ — in all my own packages, removed them when I wasn’t debugging

Removing GetOpt::Long usage was pretty time consuming. I solved it in about 100 lines of code while still keeping something very close to the original GetOpt syntax, but turning it into a map. Kinda fun, but a bit nail-biting at the same time. Resulting function weighted in at under 100 microseconds.

Result? 6.6 milliseconds run time! I was able to operate the script upto to 68 times a second.

Bullitt and EcoShopper — a Dynamic Duo

I’ve used my Larry v. Harry Bullitt with my Bicycle Revolutions EcoShopper trailer a surprising number of times. Just today I delivered about 200lbs of computer recycling to Haywire Computer in Bellingham. One of the conveniences is that I can yank the cotter pins on the trailer wheels and pack the wheels into the trailer and load the trailer into my bakfiets.

IMAG0135

IMAG0136

IMAG0137

IMAG0139

IMAG0140

IMAG0141

IMAG0138

bungee keep the trailer tounge out of the spokes