February 15, 2012

Campaign to Eliminate Log4J Pattern Layouts Containing Conversion Character “%L” in Performance Sensitive Components.

A fantastically horrible title, but please savor this trivial homespun tale of squeezing the microseconds out of my underwear  Log4J configuration.  

At my new place of employ, I was unaccustomed to seeing smallish parenthesized numbers in log statements:

2012-02-06 14:00:46,916 INFO  [Thread-2] ContextLoader (189)- Root WebApplicationContext: initialization started
I gave it little thought until one day I tripped over a typical LOG4J patterns in use around these parts:
<param name="ConversionPattern" value="%d %-5p [%t] %c{1}(%L) - %m%n" />

It turns out that conversion pattern reckons the source file line number.  I’m assuming it had been employed to aid developers.  However, the use of that little critter comes with the following caution in the Log4j JavaDocs:

 L
Used to output the line number from where the logging request was issued.
WARNING Generating caller location information is extremely slow and should be avoided unless execution speed is not an issue.

So .. it’s been nagging me.  Just how slow could it be?   Well … I finally did a what they call a micro-benchmark using Google’s Caliper framework.  I tell you what!  That Caliper is a marvel – it intercepts stdout & stderr, warms up caches, heats up the JIT compiler, and all them other gory details to help make sense out of measuring things in a JVM.

I ran a test using 2 patterns differing only by that %L bugger:

private static final PatternLayout LINENUMBERS = newPatternLayout("%d %-5p [%t] %c{1} (%L) - %m%n");
private static final PatternLayout NO_LINENUMBERS = newPatternLayout("%d %-5p [%t] %c{1} - %m%n");

Ohmygosh! There was an order of magnitude difference:

 0% Scenario{vm=java, trial=0, benchmark=LineNumbers} 816290.85 ns; σ=6878.06 ns @ 3 trials
50% Scenario{vm=java, trial=0, benchmark=NoLineNumbers} 76665.96 ns; σ=22184.19 ns @ 10 trials 
             benchmark    us linear runtime
  LineNumbers_no_parms 816.3 ==============================
NoLineNumbers_no_parms  76.7 == 
vm: java
trial: 0
Note: benchmarks printed 183162000 characters to System.out and 0 characters to System.err. Use --debug to see this output.

If I’m seeing what I think I’m seeing, that %L critter appears to cost almost millisecond per log line.   Don’t let that get yer real-time system in trouble, ya hear?


November 17, 2011

In SocialBookFace, the Music Plays YOU!

[originally posted on Rdio] I’m afraid the road ahead for digital music purveyors will continue to be bumpy. Expect the multi-billion dollar social media investment bubble to get serious about demanding returns from advertising, entertainment, gaming, and publishing revenue streams.  Maybe it’s already started with the arrangements made between Facebook, Spotify, MOG, Pandora, Rdio, et al.

big brotherPerhaps as an appropriate seque – what about that☟&✖% SOPA bill in the House? Run any kind of a web site, link to the wrong place and have your DNS pulled and payment processors turned off, just like they do in China and Iran. Regard who’s giving supporting testimony: the Register of Copryights, the MPAA, Pfizer, MasterCard, and the AFL-CIO. Certainly no friends of the kind hosts here.

Ugh. Sorry. I’ll include ponies and rainbows in next post.

September 1, 2011

Rust Wall

Rust Wall by Lex LeChef
Rust Wall, a photo by Lex LeChef on Flickr.

July 6, 2011

I think it’s on with Google+

I read this snippet in Business Insider regarding Facebook’s troops defending their turf against the limited introduction of Google+Zuckerberg's Google+ profile

Everybody’s on Facebook already. Philip Su, the engineer who worked on Facebook video chat, said it’s a one button click to any friend “on the social network that already HAS all your friends.” That’s definitely not the case with Google+ yet.

I commented:  Yes, “everybody’s” on Facebook already .. but so many of my cohorts don’t really want to be there. I don’t need Facebook for work but I couldn’t do business without Google, GMail, Google Apps, Reader, and such. If Google+, LinkedIn, and Twitter can provide all required social interactions, I heartily welcome having one less presence to maintain. Had Google acquired LinkedIn, it might have been game-over.

If you’ve got a Google+ account, what do you think?   Does this resonate with you?

April 28, 2011

Dear Metacafe ..

Hello Site Architect, Security Officers, CTO, and other potentially suspicious characters at Metacafe -

I landed at your site today as result of searching for a video showing the best music making applications for tablet computers.   I was shocked and dismayed when I noticed that underneath the first video I clicked on was a comment box awaiting my input displaying my Facebook profile picture.   You might wonder why I thought this was a serious problem.  Well, for starters, I’ve not enabled Facebook Connect with your site.  Actually, I’ve never even registered at Metacafe.  Geez, I wasn’t even logged into Facebook on any computer and hadn’t been for days.


So my question is this: why is my %)*&^ Facebook identity showing up on your site?   I know this probably isn’t all your doing and I ought to be pestering the alpha geeks over at Facebook as well, but, honestly, I am just a little bit sick of Facebook detritus following me everywhere, and the less time I spend there, the better I feel.  Besides, I’ve no patience for another  “oh my gosh .. we’d never do anything like that” response.

I understand that Facebook is not going away any time soon.  And there’s little chance of me erasing my Facebook account as my elders unfortunately have irrevocably and mistakenly substituted it for the telephone. But I really think there is room in the universe for healthy population of Things Not Connected To Facebook. So is there any chance you could not line up like the millions of other lemmings and just say no to auto-magic, opt-in by default, creepy stalking technology?

So, in closing: I now hate your web property.  How do I delete any and all association with my information from your site?

Thank you.

April 15, 2011

Two Informative Sources

There are two of pieces of media I consider essential in understanding what informs me both as an employee and as an entrepreneur. One piece is a video of David Heinemeier Hanson (a.k.a. DHH – inventor of Ruby on Rails), a partner in 37signals, the maker of Basecamp. First, a little background on that business.

Quoted by 37signals on April 13 2011:

Basecamp was done almost entirely without risk. It was completely self-funded. We treated it as a side-product and a side-project until it could pay the bills. And only then did we make it the main focus of the company.

I absolutely hate risk. I think it’s a misnomer that entrepreneurs somehow are in love with risk and making big gambles and taking big bets. I think that’s probably true for some. It’s certainly not true for me. And I think it’s certainly not true for a large constituency of other successful entrepreneurs.

I think the act of putting yourself in a position where you’re not forced to take on all this risk and bet everything is the hallmark of running things well.

— David on “The 8BIT Podcast.” He talks business philosophy, 37signals, and REWORK (interview starts at six minutes in).

The video I find inspirational is a talk DHH gave entitled A Secret To Making Money Online at Startup School in 2008 (on Youtube and on dotsub with subtitles). Unfortunately the slides he’s speaking to aren’t available. But I think the talk is brilliant, even with his bombastic style. 

The second piece is a slide show deck Netflix has shared explaining their corporate culture. It is inspiring, fascinating and transformative. (on Slideshare).

I hope you find them as informative as I do.

March 31, 2011

Early April Fools joke at Google Finance?

Go to Google Finance and follow these steps:

  1. Select the stock screener with default criteria (wide open ranges).
  2. Sort results by market capitalization.
  3. Note that AAPL, whose market cap is around $321B does not appear at #2 after XOM (about $417B) as expected.
  4. Change criteria to show stocks whose market cap is between $200B and $400B .  It still doesn’t show up.

Is this part of a forthcoming April fools joke – a world without Apple?   If Apple didn’t exist, Google would have had to invent it, right?

stock screener sorted by market cap

No AAPL

February 2, 2011

Init.d rc Script to launchd.plist Translator

The world really needs one of these.   It  would make Linux based services so much nicer when brought over to Mac OS X.

The problem seems to be that no one has the time to understand the completely different approach to agent and daemon management in OS X when adapting their Linux service to the Mac.  And unfortunately it is not a simple case of wrapping existing service scripts:  *nix init/rc scripts implement the starting and stopping whereas launchd performs this uniformly for a programs as specified by a configuration file.  Furthermore, launchd decides when to start, stop or re-start programs and requires that the program not actually do things that some classic daemons do, like run in the background and direct standard output to /dev/null.

So unless somebody takes the time to extract the intent in the service scripts, we get open-source services [Hello JBoss!] on OS X that just don’t fit well.

References

launchd on Wikipedia

launchd source code – Apple re-released the source code under Apache license in hopes open-source crowd might adopt it as a replacement for initrc, init.drc.dinetdxinetdatd, and crond.

launchctl(1) – Manual page for launchctl, the user interface for launchd,

launchd.plist(5) - Manual page for the data specifying a job to be managed by launchd,

Tags: , ,
October 29, 2010

the place just ain’t the same… …without Billy Ruane

September 2, 2010

My heart still belongs to Lala

My Lala profile

dude, where's my Lala?

I’ve just taken a test drive of Apple’s Ping and I am totally underwhelmed.   As a user of Pandora, Rhapsody, Last.FM, MOG, and most significantly, Lala, I am completely befuddled.  Why in the world would only iTunes purchase history be considered in user profile creation and not the wealth of data contained in the user’s iTunes library?  There are play counts, ratings, playlists, genre tags, BPM annotations and so forth.  No, really, can someone explain this to me? As it stands, Ping is utterly worthless to the musically driven social net citizen and is not likely to perform a meaningful social networking function in Apple’s marquee media store.  Surely Apple must realize how scale-free social networks are formed.  Without well-connected nodes capable of generating quality content, and without those nodes’ mass of preference data there is nothing going on here.   Had my library and playlists been pulled in I just might have cared enough to write some reviews, invite my tribe and hang around long enough for a little more Lala DNA to show up.  Not a chance now.

In summary, dear Apple, compare and contrast how hard Last.FM works to import and export user music preferences.

Tags: , , ,
Follow

Get every new post delivered to your Inbox.

Join 81 other followers

%d bloggers like this: