?

Log in

No account? Create an account
Who, me? [userpic]

GIP: HULK RANT!

July 29th, 2009 (04:48 pm)
Tags:

Earlier somebody on our internal IRC pointed out something bizarre (for those who care: "cat -v" has to know locale settings). I wanted to express geek outrage over it, but I didn't have time, so I just said HULK RANT! A while later someone else, in another connection, said, jstracke's "HULK RANT" pretty much sums it up.

So I decided I needed an icon for it. Here.

Comments

Posted by: blue shark of friendliness (ckd)
Posted at: July 29th, 2009 09:01 pm (UTC)
cpu

At my last job, several of the bioinformatics folks were complaining that sort was really slow, so clearly the machines must be overloaded.

Once I told them to make sure that LANG was set to C in their script instead of inheriting en_US.UTF-8, they were amazed at how much faster the machines were....

Posted by: Who, me? (metageek)
Posted at: July 29th, 2009 09:22 pm (UTC)

Yup. And it's not just programs—it's amazing how many standard C functions have had locale awareness larded onto them. And, just to rub salt in the wound, the locale subsystem doesn't cache the result of getenv("LOCALE").

At Akamai, I was working on improving the performance of the DNS server. DNS names are case-insensitive, so we had many calls to strcasecmp(). This showed up in the profiler as many calls to getenv()...and, of course, getenv() does a linear search.

I spent a surprising amount of time reading glibc source code at Akamai.

Posted by: metahacker (metahacker)
Posted at: July 30th, 2009 12:50 am (UTC)

Good to know!

Posted by: dsrtao (dsrtao)
Posted at: July 29th, 2009 10:14 pm (UTC)

It makes sense, though -- -v is basically the only time cat has to figure out how to interpret the input for display. -T doesn't incur that because it's a specific single character being interpreted differently... but who knows what counts as whitespace without consulting locale?

I think I could do just as well with a cat that doesn't have a -v, though.

Posted by: Who, me? (metageek)
Posted at: July 29th, 2009 11:03 pm (UTC)

I think I could do just as well with a cat that doesn't have a -v, though.

Yeah, that was consensus. It gets worse, though: the source code for /bin/true is over 80 lines, and it calls setlocale(). Most of that is GNU boilerplate.

Oh, and true.c includes 9 lines so that, with a #define, it can also be compiled to produce /bin/false. If not for the boilerplate, though, false.c could be less than 9 lines total, so it's not really a savings.

Posted by: blue shark of friendliness (ckd)
Posted at: July 30th, 2009 05:45 am (UTC)
cpu

Though you can't blame everything on GNU coders. Back in the days when I was dealing with Big Blue Iron, I was using IEFBR14...basically the IBM equivalent of /bin/true. Read about the way it got bloated after needing some bug fixes (yes, in the null program)!

Posted by: C. Virtue (cvirtue)
Posted at: July 29th, 2009 10:15 pm (UTC)

I guess I'm face-impaired today. I had to stare at it for several seconds (10?) to realize it was a face! Cool idea, pity you had to come up with it!

Posted by: Who, me? (metageek)
Posted at: July 29th, 2009 10:56 pm (UTC)

I guess I'm face-impaired today.

No, the Hulk's face is impaired.

I had to stare at it for several seconds (10?) to realize it was a face!

Hmm. Maybe it's not such a good icon, then.

Cool idea, pity you had to come up with it!

Oh, it wasn't all that bad; "outrage" probably overstates it. More than "boggled", though.

8 Read Comments