Categories
Google Hardware

Chromecast

Example of Chromecast mirroring.

Of course I couldn’t pass up a $35 gadget that plugs into my TV and connects to the internet. This is my weakness.

Installation was painless, plugged right into my receiver and the client app you install on your computer found it ASAP. A few minutes (I use WPA2 + MAC filtering) and it was connected to my network and I was streaming video. It looks like it has too main operating modes: mirroring (Hulu seems to use this), and playing from the cloud (which is how YouTube seems to work).

There is a noticeable lag between the video on my laptop and the video on the TV, however the video on the TV is rather good. Sound quality is also pretty good. I went into the options and choose the higher bitrate. So far it’s smooth and runs well.

Categories
Mozilla

Perception Of Performance

Google is pervasive about associating Chrome with being fast. It’s was their primary pitch when they first announced it. Back when Firefox went 1.0, it wasn’t so much about speed but “not sucking” as all the geeks liked to say. Given IE 6 was the competition, that was likely the best marketing on earth. Sure it was faster, but sucking fast wasn’t nearly as good as not sucking. Not sucking encompassed the missing features, broken rendering, crashing, constant parade of security problems. It summarized the product surprisingly well for not being an official slogan by any means.

Google now launched Chrome for iOS. On the desktop Chrome and Safari both use WebKit, Chrome applies it’s own touches to make things faster. Notably they have their own JS engine. Safari also has it’s own JS engine. This is the secret sauce of performance. In the iOS world however Apple being the totalitarian dictator decided that iOS will provide WebKit and JS. If your app has any web browser functionality it will utilize these API’s and not implement it’s own engine. Verbatim:

2.17 Apps that browse the web must use the iOS WebKit framework and WebKit Javascript

Google Chrome for iOS however is Google integration into a reskinned experience of Safari. It’s the same browser. Just a new UI bolted on with some Google features integrated in. It’s not a separate browser. It’s a UI.

That however doesn’t stop Google’s marketing machine (I’d argue Apple marketing’s top rival) from putting “fast” as the second word:

Browse fast with Chrome, now available on your iPhone, iPod touch and iPad. Sign in to sync your personalized Chrome experience from your computer, and bring it with you anywhere you go.

It goes on to clarify:

  • Search and navigate fast, directly from the same box. Choose from results that appear as you type.

So Google isn’t truly misleading. It’s just very strategic wording.

The truth of the matter however is that Google Chrome on iOS is substantially slower than Safari. Safari uses Nitro to accelerate JavaScript, which powers most of the complicated websites that will slow down a browser on any modern device. Apple however restricts Nitro to Safari, and doesn’t let third party apps like Google Chrome use it. This is still the case as of iOS 5, and I believe is the case in iOS 6, though I haven’t personally verified that.

How much slower is Google Chrome on iOS in comparison to Safari? Well Here’s a SunSpider test I did on my iPad 3:

Safari

============================================
RESULTS (means and 95% confidence intervals)
--------------------------------------------
Total: 1817.9ms +/- 0.2%
--------------------------------------------

3d: 214.7ms +/- 1.1%
cube: 72.3ms +/- 0.7%
morph: 57.9ms +/- 0.9%
raytrace: 84.5ms +/- 2.2%

access: 224.9ms +/- 0.6%
binary-trees: 44.4ms +/- 1.7%
fannkuch: 96.2ms +/- 0.6%
nbody: 56.0ms +/- 0.0%
nsieve: 28.3ms +/- 2.7%

bitops: 141.0ms +/- 0.4%
3bit-bits-in-byte: 23.4ms +/- 1.6%
bits-in-byte: 29.5ms +/- 1.3%
bitwise-and: 37.8ms +/- 1.5%
nsieve-bits: 50.3ms +/- 0.7%

controlflow: 15.7ms +/- 2.2%
recursive: 15.7ms +/- 2.2%

crypto: 123.3ms +/- 0.6%
aes: 70.5ms +/- 0.5%
md5: 29.4ms +/- 1.3%
sha1: 23.4ms +/- 1.6%

date: 274.4ms +/- 0.7%
format-tofte: 139.8ms +/- 1.1%
format-xparb: 134.6ms +/- 0.7%

math: 175.1ms +/- 0.3%
cordic: 61.5ms +/- 0.8%
partial-sums: 74.4ms +/- 0.7%
spectral-norm: 39.2ms +/- 0.8%

regexp: 70.8ms +/- 0.6%
dna: 70.8ms +/- 0.6%

string: 578.0ms +/- 0.5%
base64: 78.3ms +/- 1.9%
fasta: 68.1ms +/- 0.9%
tagcloud: 109.5ms +/- 1.2%
unpack-code: 207.5ms +/- 1.2%
validate-input: 114.6ms +/- 0.7%

Google Chrome

============================================
RESULTS (means and 95% confidence intervals)
--------------------------------------------
Total: 7221.0ms +/- 0.1%
--------------------------------------------

3d: 802.7ms +/- 0.2%
cube: 230.9ms +/- 0.6%
morph: 297.3ms +/- 0.5%
raytrace: 274.5ms +/- 0.1%

access: 1112.0ms +/- 0.2%
binary-trees: 98.4ms +/- 1.1%
fannkuch: 609.6ms +/- 0.2%
nbody: 247.9ms +/- 0.2%
nsieve: 156.1ms +/- 0.4%

bitops: 957.2ms +/- 0.2%
3bit-bits-in-byte: 210.4ms +/- 0.6%
bits-in-byte: 232.9ms +/- 0.2%
bitwise-and: 188.5ms +/- 0.4%
nsieve-bits: 325.4ms +/- 0.2%

controlflow: 129.5ms +/- 0.3%
recursive: 129.5ms +/- 0.3%

crypto: 493.3ms +/- 0.2%
aes: 214.3ms +/- 0.4%
md5: 140.2ms +/- 0.3%
sha1: 138.8ms +/- 0.5%

date: 381.1ms +/- 0.3%
format-tofte: 214.2ms +/- 0.2%
format-xparb: 166.9ms +/- 0.5%

math: 770.7ms +/- 0.2%
cordic: 316.6ms +/- 0.2%
partial-sums: 243.2ms +/- 0.3%
spectral-norm: 210.9ms +/- 0.4%

regexp: 1340.2ms +/- 0.2%
dna: 1340.2ms +/- 0.2%

string: 1234.3ms +/- 0.6%
base64: 175.7ms +/- 0.5%
fasta: 205.6ms +/- 0.2%
tagcloud: 284.0ms +/- 2.3%
unpack-code: 370.1ms +/- 0.9%
validate-input: 198.9ms +/- 0.6%

Quite a bit slower.

So really, if you’re using Chrome on iOS, it’s because you absolutely love the design and integration with Google’s services, and are willing to trade off considerable JavaScript performance for those perks.

That however doesn’t stop many people from thinking it’s fast. Just in the past few minutes I’m able to find these Tweets among the thousands streaming across the web. I won’t mention or link to them directly (you could find them however if you wanted):

“Chrome for iOS is FAST, takes the mobile browsing experience to a new level.”

“I like it! It’s fast and can sync with Chrome desktop, which I use all of the time.”

“Liking #chrome on #iOS very slick, fast and clean looking”

“using chrome on my iphone right now.. cant believe how fast it is”

“That chrome for iOS is freaking fast but so basic. No tweet button, no add-on. Man I kinda disappointed. I give ’em 1 ‘fore the update”

“Chrome for iOS? Hell yes!! So fast! #chrome”

“Google Chrome for iOS is fast.”

“Holy hell Chrome is fast on the iPad.”

The most touted feature isn’t actually a feature. It’s technically not even there. The numbers and the technology insist that it’s not (they prove it’s actually slower). But that’s what everyone is ranting and raving about. You could argue Google’s UI is faster, but I’d be highly skeptical that Google’s found Cocoa tricks Apple engineers haven’t. Perhaps a UI transition or two makes you think it’s faster or more responsive, however even that I can’t find any evidence of.

All the hard work the Google engineers did squeezing their services into a compact simple to use UI are ignored in favor of this non-existent feature. And as a developer who can’t ignore such a thing, I will say they did a great job with their UI.

I present to you, the power of marketing!

Categories
Google Mozilla

On H.264 Revisited

Once again the debate over H.264 has come up in the Mozilla community. I’ve been a strong advocate of the WebM/VP8 codec given its liberal license and abilities and still am, but agree H.264 needs to be supported. It’s a requirement for mobile (B2G), and becoming necessary on the desktop.

A little over a year ago Chrome talked about dropping support for H.264. To date they have not done so, or given any indication that is even still in the plans as far as I know. In 2010 Adobe said they would be supporting WebM (link in that same blog post). They too have failed to live up to their promises. In either case I’ve found no indication on the internet they ever plan to go forward with those plans.

I suspect in Google’s case they were pressured by various providers and mobile partners who don’t want to encode or support another encoding. Google’s been trying to woo anyone/everyone for the purposes of Google TV and presumably YouTube. It’s likely just not worth it for them to push. There are various theories floating around about Adobe including a lack of clear Flash strategy in an HTML5 world. Adobe does however have a “tools” strategy. Perhaps time will tell.

Furthermore Apple and Microsoft are fundamentally opposed to WebM as they are both licensors for H.264. The odds of them supporting something that hurts their bottom line unless the rest of the web is threatening to leave them behind is nearly 0.

I question however if it should be bundled vs. using system codecs. Windows XP aside, system codecs mean that Microsoft and Apple are essentially responsible for making it work as well as the expense. Plugins could be used for OS’s that don’t ship with the appropriate codecs.

It’s time to put some effort into a JavaScript player for WebM and make that liberally licensed. Browsers still aren’t quite there, but eventually the day will come when that’s workable. The web will then gain the ability to have video play on any (modern) device. Just not natively. That is the backdoor for an open codec.

The real issue is larger than the <video/> element. It’s software patents and their ability to undermine innovation and progress. It’s important to keep this in mind. Just look at mobile. It’s completely possible that the entire mobile industry could come to a halt over patent lawsuits and fear of lawsuits. All it takes is a company willing to press the button. Google spent $12.5 billion in what is essentially the patent equivalent of nuclear proliferation. That’s how real the threat is perceived. H.264 is arguably a fart in a hurricane.

Categories
Mozilla

JSNES JavaScript NES emulator

Ben Firshman wrote a rather impressive NES emulator. There are already quite a few NES emulators out there already this one impressive is because it’s written in pure JavaScript.

Yet another application of “Atwood’s Law“:

Any application that can be written in JavaScript, will eventually be written in JavaScript.

I should note that I mentioned back in January how someone ported Super Mario brothers to JavaScript. JSNES is different as it is actually emulating and reading ROM’s (looks like they are hex’d), rather than just replicating the game.

Currently it runs in all modern browsers, but only Chrome’s <canvas/> performs well enough at this point to really be playable. With WebGL coming to Firefox and WebKit we’ll hopefully see a lot more of this kind of stuff in the future.

Categories
Google Mozilla

about:internets

This is what you see when you visit about:internets. This is freaking awesome.

Years ago there was an idea to include the kitchen sink in Mozilla (you can view it here, not sure if that works in IE). It was a good idea considering it had everything else at the time.

I initially thought it was written using <canvas/>. I tried the typical view-source:, but in this case it doesn’t seem to work. The performance was really smooth with minimal CPU, more than <canvas/> typically allows. Now I was curious.

Then looking at the source it became obvious in about 0.1 seconds:

PathService::Get(base::DIR_SYSTEM, &path);
file_util::AppendToPath(&path, L"sspipes.scr");

It’s using the actual Windows screensaver (which is why it doesn’t work in Vista I presume). I hope for the Mac and Linux port they bundle jwz’s excellent XScreenSaver. Due to jwz’s impact in browsers and open source, I think there would be even better easter egg. From a quick look at the code it seems it’s not hard to do since every tab is it’s own process, it’s essentially just running the process inside the view.

For those who don’t understand why this is all so amusing, read this Wikipedia article about the “Series of Tubes“. It will only kill a small percentage of brain cells since it’s just the Wikipedia article explaining it. There are other Tubes references as I mentioned last night.

Thanks to those who left a comment in my last post for pointing this out.

By the way, check out Brendan’s post on TraceMonkey performance. He did a better comparison at actual JS performance. I only looked at selectors really quick.

Categories
Google Mozilla

Initial Thoughts On Google Chrome

I figured I’d blog my initial thoughts on Google chrome. Rather than a hard to read essay, I figured bullet points are easier to read/scan, so that’s what I’ll do.

Announcement

  • Another One Bites the Dust – The classic Queen song was played both before and after the presentation. I can’t help to think this was an intentional joke about a browser biting the dust.
  • From Scratch – How can a browser be both written from scratch, and based on the existing WebKit at the same time? Is this a bug? 😉
  • Ben Goodger – Did a good job selling the UI.
  • BSD License – All of it is BSD licensed. Very interesting that it’s not pulling a Safari. Chromium Project, V8.
  • Incognito Mode – Ben/Brian discussed it without mentioning the word “Porn”, though you can somewhat tell that they were both dying to use the “P” word…. uhh for research… for a friend!
  • Static Content Performance – As shown in the demonstration: IE7: 220.64ms, Chrome: 77.28ms. Less is more.
  • Dynamic Content Performance – As shown in the demonstration: IE7: 5.8 RPH, Chrome: 569.3RPM. More is more.
  • Search Box Missing – I agree with merging the search box with the url bar. It makes sense and results in a cleaner UI.

My Testing

  • Build – This is build 0.2.149.27 (1583)
  • UseragentMozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13. Noteworthy that they keep “Safari” in there. This looks like what I’d expect.
  • Bug Type – “reporter” feature has a “Bug type” called “browser crash… go boom”. I like jokes in software.
  • Tubes – The gears plugin in the chrome install has the file description “These are the Gears that power the tubes!”. Awesome Ted Stevens reference.
  • History View – I always wanted the history view in Firefox to be in a page rather than a sidebar. I understand the thought behind the implementation, but when you see how Chrome is laid out, it’s clearly superior.
  • No PPC Support – Because of how V8 works, I strongly suspect Google Chrome will never support Mac/PPC despite it still being supported by Apple until (likely) 10.6. In the press conference they said anyone can port V8 to another platform, if you have 3-4 months. Doubt they will use any other engine for that one platform. I’d say it’s toast.
  • Chrome API – The announcement mentioned plans for an extension API. Looking at the files it ships, it looks like almost all dll’s. Because of this I doubt we’ll see a method as simple as Firefox. Not sure how the interface is put together but it doesn’t look like anything as flexible as XUL, Boxely or XAML.
  • about: – So far I’ve found about:, about:memory, about:plugins.
  • Slickspeed Test – Ran a test and found Chrome did 115ms, 130ms, Safari 3.1 did: 28ms, 68ms, while Firefox 3 did 179ms, 294ms (prototype, jQuery). Interesting that Safari selectors are still faster.
  • Walt Mossberg – Everyone’s favorite tech writer Walt Mossberg wrote:

    Despite Google’s claims that Chrome is fast, it was notably slower in my tests at the common task of launching Web pages than either Firefox or Safari. However, it proved faster than the latest version of IE — also a beta version — called IE8.

  • Icon – Daniel Glazman identified the source of inspiration for the icon.
  • Phone Home – Matt Cutts has a blog post on when Chrome phones home
  • Omnibox – It’s ability to find new search engines is pretty neat… wonder how well that really works in day to day browsing though. Otherwise it’s essentially an Awesomebar to me.
  • Application Shortcut – The Prism-like functionality is just that. Essentially it just passes the url as a param into the Chrome exe via a shortcut. Looks like unless Gears is used you’ll use the Favicon which looks pretty bad.
  • Download Manager – The download manager is pretty cool, but if you download a number of files, I think this interface can get pretty cumbersome. Just like Thunderbird with a lot of attachments.
  • Font Rendering – It looks like they are using GDI Text rendering to avoid that blurry mess that Safari uses on Windows. I suspect Apple will do the same soon.

Overall it seems pretty smooth. From what I’ve seen, the process model does result in more memory in total than Firefox 3, since most tabs I open stay open for quite a while. It’s clearly still a little rough, but it’s not even out for 12hrs yet.

I await a Mac release. I just realized Pinkerton is working on Chromium as well, so I have a feeling the Mac release won’t suck but will be a real port that looks and feels like a Mac application should.

I don’t think it was mentioned in the press conference, but the Chromium blog is open.

Wired has a great article on inside the project. In addition to the names I mentioned yesterday, Bryan Ryner was also involved in at least the prototype.

I’ll make one prediction: The code most likely to find it’s way into other browsers is the GreenBorders stuff. It was originally for IE/Firefox, making it most suitable for possible adaptation to be included in other browsers. I’m not sure how much of it remains and how easy to adapt it would be though.

I’ll leave this “review” right here and unfinished since it’s still an ongoing project. Just wanted to share my initial thoughts. I’ll follow up at some point in the future when I feel it’s right to do so.

Any thoughts/additions? Feel free to leave a comment.

Edit [9/2/2008 @ 10:55 PM EST] – Added prediction about GreenBorders and link to Wired Article.

Categories
Firefox Tips Mozilla

Firefox Tip: Customize Your Browser UI

Did you know you can customize your browsers interface. Want a print button in the browser toolbar like you had in IE? “New Tab” button? Download Manager? No problem. Just right click on the toolbar and select customize. You’ll see a window with various icons appear.

From here you can just select what you want by dragging it to the desired position in the toolbar. You can remove an item from the toolbar by just dragging it off. Feel free to reposition items as well. It’s all customizable via drag & drop. You can set it up any way you like. It’s your browser.

Don’t worry about messing things up, if you don’t like what you did and want to go back to the defaults just press the “Restore Default Set” button in that window.

Categories
Mozilla

Reporter Status Update

Well, they aren’t done yet, but I thought I’d share some new reporter screenshots. As you can see quite a few refinements. Still a little rough, but I think it illustrates how simple the process is. There’s some obvious UI uglies still in there. It can take well under 30 seconds to submit a report.

Privacy Statement

Form

All done!

We automate the collection of just about all the important data, so we can make sure we get a pretty accurate rundown of what is included.

Still missing is collecting some buildconfig info. So if anyone knows why the following code doesn’t work, let me know:

function getBuildConfig() {
 
  var ioservice =
     Components.classes["@mozilla.org/network/io-service;1"].
       getService(Components.interfaces.nsIIOService);
  var channel = ioservice.newChannel("chrome://global/content/buildconfig.html",
                                     null, null);
  var stream = channel.open();
  var parser = new DOMParser();
  var buildconfig = parser.parseFromStream(stream, "UTF-8", stream.available(),
                                   "application/xhtml+xml");
  return buildconfig.documentElement.firstChild.textContent;
}
< ?pre>
Categories
Mozilla

Write File

Can anyone tell me why this code doesn’t work in Thunderbird 0.9 (I haven’t tried Firefox 1.0).

Note: There is a slash in the directory path C:, for some reason wordpress is fudging it up. MovableType did this crud too. So it’s not showing, but it’s there in the code.

function sync()
{
testFileOutputStream("C:\foo.txt", "la la la \n robert");
}
 
function testFileOutputStream(path, buffer) {
  // file is nsIFile, data is a string
  var stream = Components.classes["@mozilla.org/network/file-output-stream;1"]
    .createInstance(Components.interfaces.nsIFileOutputStream);
 
  // use 0x02 | 0x10 to open file for appending.
  stream.init(nsLocalFile(path), 0x02 | 0x08 | 0x20, 0664, 0); // write, create, truncate
  stream.write(buffer, buffer.length);
  stream.close();
}
 
function nsLocalFile(path)
{
    const LOCALFILE_CTRID = "@mozilla.org/file/local;1";
    const nsILocalFile = Components.interfaces.nsILocalFile;
 
    var localFile =
        Components.classes[LOCALFILE_CTRID].createInstance(nsILocalFile);
    localFile.initWithPath(path);
    return localFile;
}

Keep getting this error:

Error: uncaught exception: [Exception… “Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIFileOutputStream.init]” nsresult: “0x80004005 (NS_ERROR_FAILURE)” location: “JS frame :: chrome://extension/content/extension.js :: testFileOutputStream :: line 12” data: no]

Simply want to be able to write to C: (or any place on my HD that I specify). Prefer not to use JSlib, simply because I don’t want dependencies. It’s really borderline insane to think you can’t do something as simple as write out to a file without depending on other lib’s.

Thanks in advance.

Comments/Email as usual.