Bilbo was so kind and gentle that he spared the life of Gollum, even while wearing The One Ring.
However, there are forces of temptation that no Hobbit can withstand.
Bilbo was so kind and gentle that he spared the life of Gollum, even while wearing The One Ring.
However, there are forces of temptation that no Hobbit can withstand.
(High Roller is the name of this new theme.)
I really expected more problems. I ALWAYS have strange browser conflicts when I work on my theme. Someone with Chrome will report bad spacing. Someone using last year’s Opera will report that some screen element is floating off somewhere absurd. Someone on a mobile will be unable to reach the sidebar. Etc.
But High Roller was surprisingly smooth. Nearly all of the complaints were on readability and usability issues, and most of them were in agreement. This is unprecedented. The old thread has burned out and become obsolete. I updated the Theme several times during the day on Monday, and addressed the most serious concerns. Now that I’ve done those fixes I want to re-start the discussion in case anyone else has any issues.
The only thing left on my to-do list is to add some text above the comment box to let people know what tags they can use. Actually, I’m thinking of making a new page. WordPress only lets people use certain tags, and all else will be expunged. <span> and <div> must be forbidden because of the trouble they can cause. I’d like to take some obscure tag that nobody uses and turn it into our spoiler tag so that people can mask spoilers. Maybe <cite>? Maybe <abbr>? There are plugins that add a bunch of forum / wiki style markups for comments, but I just got done overhauling the theme to speed things up so I’m not eager to add some new filter to slow things down again.
Speaking of which, if you drag over the very bottom of the page you can see how long it takes WordPress to generate the current page. This number is apples-and-oranges with what I was using it before. It includes a bunch of processing that I wasn’t. Before, pages would vary a great deal. Slow pages would be ten times slower than fast ones. Now performance is far more uniform, and we no longer see troublesome spikes. (I really, really wish my web host would give me a CPU usage meter so I could make proper comparisons.)
And finally, I’m still undecided on the issue of threaded comments. They are certainly a double-edged sword. I feel I need to give it a week before I make that decision. Maybe I’ll put up a poll? Still thinking it over.
Again, feedback welcome. Thanks again to everyone for the useful suggestions.
Cleveland.com interviews Bill Watterson, creator of beloved ‘Calvin and Hobbes’ comic strip.
When asked about ending the strip when he did:
It’s always better to leave the party early. If I had rolled along with the strip’s popularity and repeated myself for another five, 10 or 20 years, the people now “grieving” for “Calvin and Hobbes” would be wishing me dead and cursing newspapers for running tedious, ancient strips like mine instead of acquiring fresher, livelier talent. And I’d be agreeing with them.
I think some of the reason “Calvin and Hobbes” still finds an audience today is because I chose not to run the wheels off it.
I’ve never regretted stopping when I did.
Respect.
Also: Check out that picture of him. He looks so much like the Dad in the strip. (Or perhaps even more like uncle Max.)
Two things:
The first is that the new comic is up. It examines Apple’s coming product line.
The second is that The Escapist is having a comic contest much like their video contest: Submit a comic, and you might win a steady comic gig like mine. I have even made a special edition Stolen Pixels that offers some advice on how to succeed at this.
In response to feedback from part 1, we’ve shortened the episode to 30 minutes. We’re still learning as we go and playing with the format. I think our goal is to publish two 30 minute sessions a week.
From Josh:
Apologies if Randy’s voice seems a little (or a lot) louder than the rest of us. I’m not really sure how or why that happened; Randy’s volume sounded fine when we were recording it. The deadline we set for getting this out didn’t give me a lot of room to fix it (we only recorded this early Sunday morning), but I do have a fix in mind for episode three, so this will hopefully be the last time Shamus sounds really quiet and Randy really loud.
The setup needed to pull this off is insane. Josh runs two computers. He has his gaming PC, which is doing three things:
1) Playing the game
2) Recording via FRAPS
3) Broadcasting via livestream, so that Randy and I can watch.
It’s a good thing he’s got a solid machine, because all three of these are incredibly intensive operations. He also has a laptop, which is in voice chat with Randy and I which at the same time recording our chat session.
Josh must wear two sets of headphones. One for the game, one for chat. Randy and I view the game on a three-second time delay, which is why we might seem a little slow at times.
Once we’re done, Josh takes the FRAPS recording and mixes it with the Vent recording to make our final product.
So, sorry the sound levels are wonky. We’ll get better at this as we go.
Comments encouraged and solicited.
Thirteen hours. I had so much to do yesterday, and instead I burned through thirteen hours building a completely new theme for the site. This included biting the bullet and making one controlled by CSS, instead of a table-based layout like I’ve always used.
Now, it’s pretty common for people flip out and hate every new theme that goes up. The overall reaction to most site changes are negative. So either my blog has been getting worse since its inception, or this is the type of thing that people either protest or accept without comment.
The theme needs of this site are incredibly complex by this point. With five years of posts under our belt, there is a lot of content and a lot of features that people have grown to love. Those old posts see traffic every single day, and they need to look right. We have posts with nearly seven hundred comments. We have the dice roller, which is part of the personality of the site while at the same complicating lots of small changes. We have hundreds of image-heavy posts that were authored with the expectation that the main content column would be 600 pixels wide, and those old posts would go all wonky if I changed that. The archives are long, there are lots of categories, and there are many, many little tags I’ve used for formatting specialized content over the years.
Good things about this new theme:
1) Nested comments – It’s always bugged me the @comment number system of notation that people have needed to cobble together in order to make a discussion work. It falls apart if I need to remove comments later. More importantly, it’s hard to follow discussions that go back and forth with ten other unrelated comments between them. There’s a chance this feature could lead to “first post”-ing shenanigans or a general watering down of discussion threads. If that becomes a problem, I can always disable this. Frankly, I like that people will have long, esoteric side-discussions and I’d like to encourage that.
2) Paged comments – Not crazy about this one, but it needed to be done. Comments will be broken into pages, which will have an adverse effect on long discussions. I haven’t decided how many comments per page, but I’m leaning towards 50.
3) Post navigation is vertical, comment navigation is horizontal. – A while back we had a discussion on how to handle archives, and the fact that the standard left / right vs. prev / next are completely ambiguous. The archives are now all vertical, with older being “down”. This lets us use left and right for comment pages. Hopefully this will not be too confusing.
4) Archives are now a dropdown. Yearly archives are too big to be meaningful. Monthly archives take up too much dang space. Yay for drop down boxes.
5) Faster generation. The whole point of this overhaul is to stop my site from going down when several thousand people all show up for the comic.
6) New category icons at the top. I’ve always wanted this, but could never get them to look right until now. This is because I’m 99% engineer and 1% artist. Aesthetics are hard for engineers and people with bad taste. And I am both.
Feedback solicited, although I request that people go easy on the rage. I know there will be annoyances and problems. And I know the solution looks simple to you. But it isn’t.
I don’t expect the theme to pass muster this first time out. I think I’ll leave it up for twelve hours to gather feedback and then take it down again at 6pm EST today.
I have tested in both Firefox and IE 7. If it looks terrible in IE 6, I do not care. As long as it’s readable, for IE6 users, I’m happy.
It’s time to solve a mystery. (A boring technical coding mystery.)
It’s been bothering me for years: Why does my site go down when I get linked on Reddit or Stumbleupon? It shouldn’t. I use Hosting Matters, and they host blogs that are far larger than mine without difficulty. Usually my site will just vanish for a few hours, and after the fact I’ll be able to sort out what happened by looking at the incoming traffic.
Eventually I noticed that not all traffic surges were created equal. It was really only the ones that linked to DM of the Rings that crushed my site. Links to other stuff wouldn’t even cause a hiccup, even if the overall traffic spike was larger. The natural assumption is that it must be due to the fact that the comic is image-heavy. Except, this problem persisted even when the images were moved off-site. Hmmm. What about the scripts that set up all the comic navigation stuff? That seems like a stretch. Perhaps the script I wrote that embeds images so I don’t have to clutter up my prose with a lot of HTML? Meh. It might be inefficient, but I can’t imagine it’s anywhere near bad enough to bring down the site where the average comic was one or two images. But what else could it be? What else makes the comics different from the other posts on my site?
I’d ponder this problem for a day or so and then forget all about it until the next time my site went down. This cycle has been repeating itself for a couple of years now.
I’ve finally figured it out. And I am really embarrassed at how long it took me.
It’s the number of comments. Also: Duh.
I was always looking at the early comics, where the comment count is a couple dozen or so per entry. Later in the series the comments regularly top a hundred, and the finale clocks in at just under seven hundred comments.
I run some tests on my local machine, where I have a functional mirror of this blog. It takes my machine an agonizing three and a half seconds to generate the page for the finale. Now, I’m sure the server at Hosting Matters is many times faster than my humble computer, but 3.5 seconds is still insane. Get a few thousand people in there chewing through those high-comment posts, and it’s easy to see how they could render the machine helpless. I try disabling the display of comments and it is able to generate the page in just 0.14 seconds. So 96% of the CPU time is spent churning out the HTML for the comments, and the other 4% is spent on everything else.
But why? Why is it taking so long to list the comments? My first thought is that this is caused by my dice roller. The code to display the dice for a comment is a recursive operation that subtracts from a number and then calls itself until the number is zero.
As of this writing, the current comment count on the DM of the Rings finale is 678. This requires ten levels of recursion. (Six 100 sided dice and four 20 sided dice.) Keep in mind it has to roll a handful of dice for each and every comment in the list, with the number of dice needed gradually going up.
Lots of dice times lots of comments time lots of comment-heavy posts = a crap-ton of HTML.
Every comment has a bunch of HTML around it. Nested DIV tags and SPAN tags and TABLE tags and… wow. This is really messy. There is a lot of extra stuff in here. I remember how this came about: Most of it was for cross-platform reasons. The differing behaviors of IE 6, IE 7, and Firefox were crazy to sort through, and often making very slight changes would blow out the formatting on one browser or another. Once I had it working, I stopped messing with it because I was pissed off and sick of fighting with it. So I left this crufty mess in place, even though I most likely don’t need the majority of it.
Just to make sure I’m getting a clean test, I remove ALL of this extraneous HTML. I just have a single line-break between comments, but otherwise they are a big jumble. That’s fine. I’ll sort that out later. Finally, I disable the comment editing plugin and SuperCache so that I can be sure they aren’t part of the measurement.
The code that is left is as streamlined as it gets: WordPress yanks comments out of the database and spews them onto the page without doing anything else. It now takes almost exactly 2 seconds to build the page. Nice, but I have a feeling there is still a really big bottleneck in here someplace.
Time to get systematic. Each comment has several distinct parts:
1) The comment number
2) The dice
3) The avatar
4) The name / link of the author
5) The permalink of the comment itself, which is wrapped around…
6) The date on which the comment was made and…
7) The time of day of the comment
8) An admin edit link (just for me)
9) The actual comment text
Hm. So which of these steps would be the most time consuming? My primary suspects are #2, #3, and #9. Time to run some tests. I’m going to disable an item, reload the page a few times to see how much time it saves, then re-enable it and run the same test for the next one. This test isn’t super-accurate. Values jump around in 0.05 increments, but considering how huge our bottleneck is this shouldn’t be a problem.
But let’s see how it goes…
![]() |
Uhbuhwhut?
One of my prime suspects – my dice roller – is so fast that it’s basically “free”. (I give myself a pat on the back.) #9, the comment text, is indeed a high priced thing to process. But the absurd surprise is that #6 and #7 are really expensive. Together, it takes longer to show the date and time of when you left a comment then it does to display the actual text! What!?!
I am at a loss, here. Suddenly, everything I know is wrong.
While I can’t explain why it’s taking so long to do #6 and #7, I can clearly see that I don’t need to do them both. In both cases, I’m retrieving the timestamp, I’m just printing it differently. It’s like if your mom asked you what the date is, so you decide to walk five miles into town and look at the marque at he bank. After you walk all the way back home and tell her, she sends you back to the bank to find out what time it is. I don’t know why it’s taking so long, but at least we can get both nuggets of data on the same overlong trip.
That shaves a nice chunk off of the loading time.
The next thing I notice is that there are two ways I can get the comment text. I can do it the way I’ve been doing it:
comment_text ();
Or I can replace it with a very similar line of code:
echo get_comment_text ();
The first is what takes over 0.6 seconds. The second happens so fast I can’t even measure it with the benchmarking tools I’m using. It is, in effect, “free”.
This is one of those changes that seems a little too good to be true. I must be giving up something by switching to the new way. But what? How do comment_text () and get_comment_text () differ?
I have looked in the WordPress docs, and found nothing. As in: Neither one is even listed. I looked in the support / discussion forums, and the WordPress community is its usual helpful self. In fact, someone actually asked my question.
Alan: Hey, what’s the difference between comment_text () and get_comment_text ()?
Betty: Have you tried looking them up in the docs?
Alan: Uh. Yeah? Nothing there?
Betty: Did you try reading the source?
I cannot stress how useless it is to post RTFM in a forum like this. If you don’t know, just keep your yap shut and maybe someone else will come along and help. Of course you can read the source. It’s time consuming and you’re most likely consulting the docs and forums in an attempt to learn from someone who has already done so. This is why the forum exists.
Perhaps I just have bad luck, but in all my trips to WordPress.com, this has been my experience every time. Nobody knows, and everyone tells you to read docs that don’t exist.
Sigh. Anyway.
Item #8 is also inexplicably expensive. Its only job is to print nothing to every single visitor to the site, unless the viewer is me, in which case it needs to print a little link. I never click on that link, so this element can be removed. I have no idea why it eats so much time, but at least I can cut it.
We’re now down to the page taking 0.85 seconds. That’s a huge improvement, but it really bothers me that just printing the stupid date takes half of that.
I check into it some more, and it look like all the time is being eaten when converting date formats. Apparently the date of each comment is stored thusly:
2009-03-29 15:44:10
But of course it’s much nicer to display that as:
March 29th, 2009 03:03pm
But the latter costs me 0.4 seconds. I can double the speed of this code by sacrificing usability. It seems like the thing to do is to keep the nice dates on posts with less than a hundred comments. Once a post passes this, it will start cutting corners and display the all numeric date.
(Remember, when I say 0.4 seconds, I’m talking about processing the 600+ comment page, not just a single comment. The differences would be too small for me to measure if I was only working with one comment at a time.)
I make some other minor changes, and in the end the page loading happens in about 0.31 seconds. It’s more than ten times faster than it was when I started.
I haven’t made the changes live yet. While mucking about with this mess I discovered that WordPress now supports threaded discussions. We need this here. We have large, diverse, and multi-threaded conversations on this site.
Still, it’s clear this place needs an update before the next traffic surge.
An interesting but technically dense talk about gaming technology. I translate it for the non-coders.
I scoured the Steam database to figure out what words were the most commonly used in game titles.
My picks for what was important, awesome, or worth talking about in 2014.
Why killing you might be the least scary thing a game can do.
It seems like a simple question, but it turns out everyone has a different idea of right and wrong in the digital world.
There's a wonderful way to balance difficulty in RPGs, and designers try to prevent it. For some reason.
Be careful what you learn with your muscle-memory, because it will be very hard to un-learn it.
This series explores the troubled history of VR and the strange lawsuit between Zenimax publishing and Facebook.
Yes, this game is loud, crude, childish, and stupid. But it it knows what it wants to be and nails it. And that's admirable.
Bethesda felt the need to jam a morality system into Fallout 3, and they blew it. Good and evil make no sense and the moral compass points sideways.