Fixed: My i7 Intel Dell Laptop is Ridiculously Slow

Most of the Google results I found when digging around on this subject pointed to usual boring causes of slowness: too many programs being run on startup (which you can test with ms-config if you’re running Windows), anti-virus software, and other boring stuff of that sort. In my case, I had been running Ubuntu so most of those tips are moot. But to be thorough, I did remove practically any and every resident program that was running on what should have been a zippy Dell Latitude E6520 with a i7-2720QM (2.20GHz, 6M cache) processor.

And yet, running a utility that averaged about 5 seconds on my desktop consistently took 30 seconds on my laptop. Except for every once in awhile, when it would take 6 or 7 seconds.

Before splurging for a new laptop, I decided to take a peek through my BIOS settings and managed to stumble across the culprit: the Intel “Speed Step” feature. On my Dell, this was under the “Performance” settings. I guess that the idea of Speed Step is that the i7 powers itself down when it decides you’d like your system to perform like a 486. Whatever the logic is that determines when to power down was clearly NOT working as intended on my laptop. After disabling Speed Step, I have been running for the entire day at speeds very similar to my desktop.

Hopefully someone else thinks to Google for this problem and find themselves helped by a similar approach. FWIW I suppose that this might mean that the laptop uses more battery, but you can be an informed consumer about whether you want to run fast or power-efficiently.

Why’s “open link in new tab” not working in Safari + iOS 10 + iPhone 7?

From the files of “endlessly frustrating problems that Google wouldn’t help me with.”

When I bought my iPhone 7, I couldn’t open links in new tabs in Safari for the first six months I owned it. Whenever I tried to hold a link to open it, Safari would sometimes ignore me, sometimes it would start showing a preview of the destination for that link. Which behavior it chose to do seemed to depend on the whether Mercury was in retrograde.

After much searching, I eventually learned this behavior isn’t a “bug.” According to Apple, it is the “feature” that they have long been marketing as “3d touch.” That is, your iPhone is now paying attention to how hard your touch your Safari links. If you hold a link “hard,” then, instead of popping up the context menu that allows you to open the link in a new tab, you instead get the obnoxious popup preview of the next page.

The solution to being able to pop the standard iOS Safari context menu? Hold on a link in Safari, but do it lightly, tenderly, as if you were stroking a baby dove.

This is what “intuitive UI” has become on the new iPhone.

Turning off 3d touch

If, like me, you find 3d touch to be more of a nuisance than a feature, you can disable it as follows: open Settings, search for “Touch,” and pick what should be the first option in the list:

Then click into the 3d touch option, which can be turned off for a 32% less aggravating mobile experience:

PS bonus fix! Have you had trouble moving your iPhone’s icons around since upgrading to iOS 10.1? Guess why. That’s right, 3d touch. As with the above, to move around app icons on a 3d-touch device, you have to touch them ever so lightly.

I will continue waiting for this to feel like a “feature.”

Evernote vs Quip: A note taker’s detailed comparison

Over the past 5 years, I’ve probably spent more time in Evernote than most any other productivity app. I’ve created thousands of notes across Evernote’s OS X, iOS and web clients, becoming intimately familiar with the limitations of each. Over the years, I’ve periodically tested alternatives, mostly when Evernote obliterates my changes via merge conflicts with unsynched notes. I had high hopes for Onenote when I gave it a few weeks’ test run recently, but ultimately determined it was even more fatally flawed than Evernote (not to mention how difficult they make it to import past work from Evernote).

A couple days ago I discovered Quip. It is a multiplatform note-taking app that apparently started as a collaboration platform, and was acquired by Salesforce for $750m in 2016. It sports a reasonably effective built-in Evernote importer, plus an impressive suite of free features. Based on my initial impressions, I’m giving it even odds to replace Evernote as my note-taking app of choice. Yet, like Evernote, it too comes with a set of warts.

Given how powerful-yet-flawed both products are, I’m going to attempt to enumerate, from a note-taker’s perspective, where each shines. Hopefully this list (ordered roughly by impact on my everyday productivity) helps others decide which set of drawbacks is most forgivable to them.

Evernote Advantages

  • Notes can be displayed in grid while ordered by recency of update or other criteria (Quip only allows user-defined sorting in list view…and only on desktop clients at that. C’mon dudes, allowing notes ordered by recency of update is utterly essential feature)
  • Can navigate from note to note with single click, since list of notes remains visible in left pane even when a note is being edited
  • Better UI for text formatting: resides permanently at top of each note (in Quip, text formatting options are hidden behind a sometimes temperamental popout in left gutter)
  • Support for searching phrases (not just individual words)
  • Essentially instant search
  • Not as aggressive about trying to spam all my contacts during install (unlike Quip — forcing me to manually uncheck every Google contact during iOS install. Not a great approach to build goodwill with a new user, Quip)

Quip Advantages

  • Notes are saved in real time as they’re created (!). The note’s text is automatically synchronized to all devices that have the note open. Not only does this fix Evernote’s most fatal shortcoming (merge conflicts), it also allows multiple people to edit the same document concurrently, a la Google Docs
  • Less janky checkboxes for todo lists. They don’t slow down the note when there are lots of them, they can be copy-pasted without introducing weirdness, and their line gets crossed out when you check off your todo item.
  • Spreadsheets with full Excel-like functionality (functions, etc) are natively supported, and can be inserted inline into any note
  • Code blocks can be inserted into any note (!)
  • Variety of attractive pre-built font themes can be selected and set as default for notes
  • Can use across more than two devices for free (Evernote now charges for this functionality)
  • Note’s edit history can be viewed without paying monthly fee
  • More robust feature set for collaboration (collaboration seems to have been the initial purpose behind Quip’s existence) than Evernote. Can add inline comments to any line of any note.
  • More intuitive interface for working with multi-level lists (arrows to move back and forth between list level, rather than needing to use tab+shift)
  • Can organize notes into subfolders within a notebook
  • No upsells as yet in free version

Both apps allow chatting (because everyone wants to chat in their note taking app…right?), and both allow some degree of collaboration on notes (Quip much stronger here). It’s my goal to use Quip as my primary app for the next couple weeks before I make a final call on the victor. If you have experience with either app, would be delighted to hear your power user tips in the comment section below!

Fixed: Rubymine doesn’t show files in “library” directories

If you work on a medium or large-sized Rails project, there’s a good chance that you utilize the vendor/gems or vendor/engines directories to help keep your code organized into modules (as opposed to stuffing hundreds of models, controllers and views into a web of subdirectories in the app folder).

Unfortunately for us, the Powers that Be at Rubymine do not index any of these directories in file or symbol searches under the belief that any file in these directories must be third party library code, and therefore not shown unless one checks the “include non-project files” every time they want to look up their files. Even with this burdensome workaround, one would still find their methods/files listed below any partial matches that may occur in the main project.

The fix is to edit your Rubymine project’s iml file, it’s located at [project dir]/.idea/[project name].iml. You’ll need to find “NewModuleRootManager” and make the following update within it:

<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/engines" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/packaging/vendor" />
<excludeFolder url="file://$MODULE_DIR$/public/assets" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
</component>

You’ll then need to close and re-open the project, and voila.

I have repeatedly and unsuccessfully lobbied Jetbrains to at least create an option for users to make their own decision about whether vendor/engines and vendor/gems should be treated as libraries, but they have denied the motion, telling me to file a bug for it. I did so, it lives here: https://youtrack.jetbrains.com/issue/RUBY-18315. If you care about this file, you should login to Youtrack and cast a vote for it. Or leave a comment on this blog.

Evernote QA Report: Merge & Sync

Hi Evernote,

Your sync and merge has long been broken, and I hope to provide you enough detail to get it fixed here. All the below should be reproducible, let me know if you find otherwise.
List Fruits 1

It starts simple. Create a note in Evernote webview. List some fruits. If you’re anything like me, you probably make a couple lists like this per day. All seems well. Later that day, you remember this list, and have a burning need to add “Starfruit” to it. All looks well?

2015-11-05 16.06.47
But things are not so well, because when we return to the webview, there’s some bad news awaiting:
List Fruits Double Note               ^– Now two notes, instead of one

That’s right, my fruit list has split itself in two lists with edits from desktop and mobile. Similar problems persist as I try to use the document.

Unless one is fastidious enough to sync every note when finished, and then manually sync when resuming on another platform, you are liable (at rate inversely proportional to speed of your internet connection) to soon find yourself with something like this:

Two Syncs Later

Every time I switch devices, I must remember “ensure save,” then pre-sync on the new device (and remember to confirm sync finished). Granted, there are a number of trigger points for syncs, but it’s impossible to be sure which, if any, have triggered/completed. One too-fast move, and I’m back in the ghetto of Mergetown.

I usually don’t even know I’ve been losing list items (to duplicated versions), until I notice the note lags in load/save time. And then I realize there are 10 copies of the list in my note, below the (already long) version I was treating as the “real list.”

I sympathize that getting sync to work reliably across disparate platforms is a hard problem [2]. So why not, instead of fully fixing the sync, just spend a few days fixing the merge?

If you could automatically add new lines to both documents without creating duplicate copies, that would be a good start. If you kept the note differences in the area they were found (not bottom of document), that would help. Source control tools have spent 20+ years building great systems to merge two documents. You can probably crib most of your implementation from a plugin/library in that domain? Or at least mark “duplicate documents” so I know I’ll need to hand merge them?

Thanks for considering these improvements. I take the time to write this because I still believe you’re the best solution in your space. If you could just address this fundamental stuff, I’d reap benefits greater than the (sizeable) time it took to create this report.

[1] Lists featuring fruits.
[2] Albeit the hard problem you ostensibly built your business to solve

Remove green checkbox from Dropbox on OS X

As of November 2015, here’s how to do it with one line of code in console:

mv /Applications/Dropbox.app/Contents/Resources/emblem-dropbox-uptodate.icns /Applications/Dropbox.app/Contents/Resources/emblem-dropbox-uptodate-back.icns

Then you just need to restart Finder. You can do this by opening Finder and choosing “Force quit” from the Apple menu.

The Cnet instructions didn’t work for me.

Is Gmail secure from its employees?

The recent essay from Paul Graham, “Don’t Talk to Corp Dev,” reminded me of a question I’ve wondered from time to time over the years: what would stop Google from accessing a startup’s Gmail (or Google Apps) if it were advantageous to their business negotiations? A part of me always cringes at this thought; it’s too paranoid. It goes against their culture. Still, given how bad an internal breach could be, I was curious to see what language Google would use to assure its users that their Gmail was in safer hands than, say, an Uber itinerary.

The first result I came upon in my Googling was a guy (Christopher Nguyen [1]), who on Quora who gives a clear and explicit description of what Google has done to protect Gmail from internal intrusions. The author describes a tough privacy policy that inspired several upvotes, not to mention at least two separate articles from tech sites quoting his answer as proof of “Google’s policy”. Nguyen concludes: “… ultimately, an internal culture of respecting users’ privacy helps keep [us] in check.” It sounded pretty good, like the sort of approach I’d expect Google to take.

My problem with the answer? It’s not from Google. Dropbox is explicit about how employees access data; I find their policies well-thought out and comprehensive. Evernote’s security is moderately explicit [2] that it has more lax policies [3]. Either way, I can evaluate the security of my accounts from an internal employee who might be bored some Wednesday night.

Meanwhile, Google itself is mum on who internally can read my Gmail, and for what purposes. “Gmail security”-related queries yield results ranging from how to secure your account against external entities to how Google keeps us safe from open wifi. They also assure us that they aren’t manually reading every one of our emails to serve us ads (Really?? So do they contract hamsters to pick all those ads? [4]). But nothing in my Googling can locate a Google-authored document that describes their internal Gmail security policy at all.

Does this lack of explicitness matter? I’m torn. Google’s generic privacy policy paints the picture of a company that cares about security. They seemed to get pretty upset when the NSA spied on their users. And yet, I’ve probably had more conversations in Gmail over the past 10 years than I’ve had in the real world. If there were any service I’d like to see a clear, tough, explicit policy on all aspects of data security, it would be Gmail.

I think their policies are probably as good or better than Dropbox, but at this point they are forcing me to assign an awful lot of credibility to that guy on Quora.

 

[1] Christopher Nguyen says he worked at Google between 2003 and 2008.
[2] See the “Customer Account Access” section
[3] “This [admin access] tool allows our customer service and platform administration teams to resolve customer issues.” Which customer support personnel are accessing? What do they access?
[4] Blog sarcasm

Determine Ruby GC Garbage Collection Settings

Ever wish that you could determine what garbage collection settings your current running version of Ruby was using? Me too, but Google was not much help for it. There are two techniques for getting the current GC settings.

Technique 1: Use sh

In Rails console (or debugger), you can run shell commands by surrounding your command in the “ characters. So you can do:

`echo $RUBY_HEAP_MIN_SLOTS`
`echo $RUBY_HEAP_FREE_MIN`
`echo $RUBY_GC_MALLOC_LIMIT`

The pros of this approach is that it maps directly to the way that most people configure their GC settings: by setting environment variables. This is a means to be certain that the files you think are getting sourced when you start Ruby are being loaded correctly.

Technique 2: Use GC.stat

As of Ruby 1.9, running “GC.stat” can tell you all sorts of information about your current GC stats. The drawback of this approach is that there isn’t clear mapping between the environment variables you set and the data that GC.stat returns. Anecdotally, it appears that GC.stats[:heap_free_num] corresponds to RUBY_HEAP_MIN_SLOTS. I’m not sure yet how the other variables get reflected, but feel free to chime in with a comment if you know how the standard Ruby GC settings map to the hash keys returned by GC.stat

TBTTY: Freedom February

[This post was originally sent to the TBTTY list (4), but I thought others might enjoy it too so it’s reposted here]

My favorite thing this year is February.

Last year, Bonanza started a tradition of swapping Seattle for somewhere tropical every February. We call it “Freedom February.” Its birth came from asking ourselves some pointed questions:

  • We’re an Internet company, we’re small-ish (1), why do we have to work in the same place every month?
  • How will it impact productivity if we give our team the freedom to work on their own schedule?
  • What was that bright, glowy thing that seemed to hang in the sky all day, making things warm and pleasant last Summer? (2) Can we hunt it down?

Curiosity got the better of us, so we booked some plane tickets, a month of lodging in Costa Rica, and we did it. It was more fun than I’d hoped for. There were monkeys.

Inline image 1

In response to our first question, we learned that there was really no reason we couldn’t get away with doing this every February. All we need is a connection to the Internet and this business can run itself fine. We were all friends already, but this trip reinforced our friendships and our combined sense of mission. To the second question, we got more code checked in that month than we did the month before or after, in part because of a collective spirit of working nights and weekends, even though we worked less during daylight hours. As a nice kicker, our sales also jumped about 15% that month. There was a lot to like about this idea.

This brings us to February 2014. Even before we departed, it had the makings of a TBTTY email when this victory dropped into our lap:

Inline image 2

In their annual survey of more than 12,000 sellers (the biggest/only third-party survey on marketplaces), Bonanza beat out Etsy, eBay and Amazon in whether sellers would recommend it to a friend! We had scored in the top four of this survey during previous years, but this was the first year we won both “Most Recommended” and “Top Score Overall.” Etsy, eBay and Amazon finished 2nd, 3rd and 4th to us in cumulative score. February was off to a fine start.

And then, the trip. This year, since Bonanza has a new tyke in tow (our developer’s criminally adorable daughter, Kira), we decided to visit the north shore of Oahu, where we’d have easy access to modern health care if anything important came up. Here’s Kira enjoying Freedom February 2014:

Inline image 3

In terms of Februarys, this year was even better than last year. Bonanza has grown since 2013, so we had more people = more opportunities for epic BBQs = more fun. The availability of our own hot tub this year was a nice touch too.

Inline image 4

Enjoying BBQ dinner

Inline image 5

A good time was had by all this year. But my favorite part of the trip was seeing how happy my parents were to be in Hawaii. Until I started dragging them around the world with me a couple years ago, they hadn’t been on a vacation since their honeymoon (25+ years ago). My mother in particular has more energy and enthusiasm than any of my 30-something friends, and her happy-go-lucky spirit becomes infectious in a group setting. Here’s her with my pa in front of our house:

Inline image 6

Even when I was sitting upstairs with ocean surf drowning out most sound, I could still hear my mom’s laughs echoing above everyone else’s yapping downstairs. It made me realize that I probably have her to thank for much of my willingness to fail (in jokes, in crazy ideas, in business). When you grow up with someone that thinks most everything you say is hiiii-larious, I think there’s a bit of irrational confidence that sticks to you, failures be damned.If any of you run a small-ish company and would like to give this idea a try, DM me and I’ll share what I’ve learned from my two years experience. Generally speaking, it’s less work than I had expected (3). I think “inertia” was the biggest reason it took us a couple years to try it out, but now I think that this is exactly the sort of benefit a startup deserves to compensate for all the hard work we put in throughout the year.

(1) About 15 people, many of which are remote, some part-time. So far the participants have just been folks working out of our Seattle office, but I hope to keep slowly growing the trip as long as we can employ hard workers who GSD with minimal oversight.

(2) I’m not telling. You’re just going to have to try this yourself or wait a few months and hope.

(3) The hardest part is finding the big enough+affordable lodging that’s conducive to work (i.e., has a view of the ocean). Besides that, everything else tends to fall into place, especially if you get your team involved in the planning process.

(4) Still hasn’t been posted to the list though after posting it there yesterday, so not sure exactly how “alive” the list still is

Rails 3.2 Performance: Another Step Slower

Having a large codebase means that we don’t upgrade our version of Rails very often (we’re averaging once every two years, with about 1-2 weeks of dev time per upgrade). Every time we do upgrade, though, one of the first things that I’m curious to inspect is the performance delta between versions.

For our previous upgrade, I documented our average action becoming about 2x slower when we moved from Rails 2.3 to Rails 3.0, with an action that had averaged 225ms climbing to 480ms. Luckily, in that episode we were able to pull out some tricks (GC tuning) such that we eventually got the same action down to 280ms. Still around 25% slower than Rails 2.3, even implementing fancy new tricks, but we could live with it.

When we finally decided we had to move from Rails 3.0 to 3.2 to remain compatible with newer gems, I was understandably anxious about what the performance drop was going to be based on our past experience. With the numbers now in hand, it looks like that apprehension was warranted. Here is the same action I profiled last time (our most common action – the one that displays an item), on Rails 3.0 before upgrade:

Most common action before upgrade, averaging 301 ms over 3 hours time window

 

And here it is now:

After upgrade, same time period as last week, averaging 423 ms over 3 hour time window

 

The problem with 3.2 is that, unlike last time, we don’t have any more tricks to pull out of our hat. We’ve already upgraded to the latest and greatest Ruby 2.0. We’ve already disabled GC during requests (thanks Passenger!). When we made these upgrades, they sped up our Rails 3.0 app around 25%. That performance improvement has now been overshadowed by the 40% slower controller and view rendering we endure in Rails 3.2, making us slower than we were in 3.0 before our Ruby optimizations.

Suffice it to say, if you have a big app on Rails, you have probably learned at this point to fear new versions of Rails. I fully empathize with those who are forking over bucks for Rails LTS. If we didn’t need compatibility with new gems, staying on 2.3 would have left us about 100% faster than Rails 3.0, which in turn is about 40% faster than Rails 3.2.

New Rails trumpets improvements like “ability to build single-page web apps” and “tighter security defaults” and “streamlining, simplifying” the constituent libraries. The closest we’ve seen to a performance improvement lately was that 3.2 made loading in development faster (1). This was certainly a fabulous improvement (took our average dev page load from 5+ seconds to 1-2), albeit one we already had in Rails 3.0 thanks to active_reload.

My sense is that performance has become the least of the concerns driving Rails development these days, which, if true, is a shame. If Rails put equal time into analyzing/improving performance as it does to “streamlining, simplifying,” it’s hard to believe that we would keep swallowing 40%-100% performance setbacks with each release. Maybe a partnership with New Relic could help the Rails team to see the real world impact of their decisions on the actual apps being built with their platform? If others’ experience is similar to ours, that would be a lot of pain felt by a lot of people.

I admit I’m a bit reluctant to make this post, because Rails has given so much to us as a platform, and our business is too small at this point to be directly involved in improving performance within Rails. We will, however, continue to post any salient optimizations that we discover to this blog and elsewhere.

My primary concern though, and the reason I am posting this, is that if Rails keeps slowing down at the rate it has, it makes me wonder if there will be a “point of no return” in the 4.x or 5.x series where it simply becomes too slow for us to be able to upgrade anymore. Each new release we’ve followed has been another step toward that possibility, even as we buy ever-faster servers and implement ever-more elaborate optimizations to the compiler.

Has anyone else out there upgraded a medium-to-large webapp from Rails 2 -> 3 -> 4? I’d be very curious to hear your experience? The lack of results when Googling for “Rails performance” has always left me wanting for more details on other developers upgrade experiences.

(1) New caching models may improve performance as well in some scenarios, as could the dynamic streaming when used with compatible web servers. For the purposes of this post I’m focusing on “performance” as it pertains to dynamic web apps that run on a server, which means stuff like interpreting requests, interacting with the database, and rendering responses.