Tag Archives: microsoft

Investigating Surface RT performance: Counting primes in C# and JavaScript

How is the performance of Surface RT? Tolerable but rather slow would be my quick summary. Surface RT has a quad-core NVIDIA Tegra 3 chipset.

In order to investigate further, I built a simple app to count primes, using essentially the code here. I ran the code both in JavaScript and in C#. This is a single ad-hoc and naive test that only covers one aspect of performance, but I have still found it an interesting indicator. I then ran the app both on my Intel Core i5 Samsung Slate and on Surface RT (yes it was interesting figuring out how to debug on Surface RT in a hotel room).

Here are the results:

On Intel Core i5:

  • Count primes up to 1,000,000: 1.05 secs (in browser)
  • Count primes up to 1,000,000: 0.88 secs (in embedded webview)
  • Count primes up to 1,000,000: 0.32 secs (C#)
  • Count primes up to 10,000,000: 6.31 secs (C#)

On Surface RT:

  • Count primes up to 1,000,000: 3.49 secs (in browser) Slower by 332%
  • Count primes up to 1,000,000: 3.53 secs (in embedded webview) Slower by 401%
  • Count primes up to 1,000,000: 1.81 secs (C#) Slower by 565%
  • Count primes up to 10,000,000: 49.03 secs (C#) Slower by 777%

The Core i5 is running at 1.6 Ghz. Surface RT has an NVidia Tegra 3 1.3 Ghz chipset.

You could count primes more quickly in both cases by using parallel processing; this is a single-threaded test.

What is notable here?

  • First, Surface RT is slower than I would expect and I hope Microsoft improves performance with future updates.
  • Second, C# is substantially faster than JavaScript in this test, around twice as fast, which makes me question the advice I have heard from some spokespersons that HTML and JavaScript is the preferred approach for apps.
  • Third, the factor by which C# is slower is greater than the factor by which JavaScript is slower. This surprised me; I had expected the reverse for some reason.

Of course, other performance tests will yield different results. When I tried the Sunspider JavaScript test Surface RT was about 5 times slower.

One piece of good news: there was little difference between performance in the embedded or non-embedded browser.

Update: I also tried this test in C++. There was barely any difference. The Core i5 counted primes up to 10,000,000 in 6 seconds. The Surface RT performed the same feat in 46 seconds.

Update 2: A Google Nexus 7, which also has a Tegra 3 chipset, can only manage 76 seconds for the JavaScript test (primes up to 10,000,000).

Steve Ballmer shows off Windows 8 in Build keynote

Microsoft’s BUILD conference has kicked off in Redmond with a keynote featuring CEO Steve Ballmer, Developer evangelist Steven Guggenheimer, and Kevin Gallo from the Windows Phone team. There were also a few guest appearances, including Tony Garcia from Unity, a cross-platform games engine.

The company has a lot to talk about, with Windows 8 just launched – four million upgrades sold so far, we were told, which seems to me a middling OK but not great result – and Windows Phone 8 also fully announced for the first time.

The keynote opened with a performance by Jordan Rudess from Dream Theatre, enjoyable and somewhat relevant given that he has helped create two music apps for Windows 8, Morphwiz and Tachyon, which he talked briefly about and played on a Surface RT and Lenovo desktop.

image

Then Ballmer came on and gave what I can only describe as a hands-on tutorial in how to use Windows 8 apps. I found this odd but it was well received; my conclusion is that many people have not bothered to look closely at Windows 8, or have been put off by the Start menu issue, and much of what Ballmer showed was new to them. It was not to me, so I was not gripped by this section of the keynote.

I preferred the presentation from Steven Guggenheimer; most of what he presented is also covered here, and included the announcement of forthcoming Windows 8 apps from Disney, ESPN and Dropbox. The Dropbox announcement is particularly significant, since I have heard complaints about its absence from Surface RT, which is unable to run the usual desktop client for Dropbox. Another app that is on the way is from Twitter. Guggenheimer also described a new PayPal API for Windows Store apps.

I do wonder why key services like Dropbox and Twitter are only now announcing Windows 8 apps. Windows 8 has been available in preview versions since last year’s Build event, and has not changed that much as a developer platform.

Gallo introduced some of the new features in Windows Phone 8, and claimed that Microsoft has delivered the majority of developer requests in the new Phone SDK which is available from today. He emphasised the possibility of sharing code between Windows Phone 8 and Windows 8, using Visual Studio to ensure compatibility.

Garcia presented Unity for Windows Phone, which is potentially a big deal, since it is widely used. The demo of immersive gaming graphics on Windows Phone 8 was impressive.

image

Finally, Nokia’s Richard Kerris came on, mostly to announce a giveaway of the new 920 Windows Phone 8 device for Build attendees.

image

This raised a loud cheer as you would expect, though it may be significant that the free phone won an even warmer reception than the earlier announcement of a free Surface RT.

The cost of signing up for a Windows Phone developer account has been reduced to just $8.00 for the next few days; see here for more details.

Did Microsoft do enough in this keynote? Personally I would like to have seen more technical depth, and a more convincing presentation of why the company thinks these new devices have what it takes to take on Apple and Google. Still, this is all about partners, and the arrival of Dropbox and Twitter as Windows 8 apps, and Unity for Windows Phone 8, are all significant events.

Windows 8 launches: key questions remain, but Surface shines

I am in New York for the launch of Windows 8. This morning was the general launch; the Surface RT launch is to follow this afternoon. Windows chief Steven Sinofsky introduced the event. I was intrigued by how dismissive he was about a key Windows 8 issue: the learning challenge it presents to new users. He gave the impression that a few minutes experimenting will be enough, though he also referred to a guide that may be new; yesterday I picked up a small booklet which I had not seen before, introducing Windows 8.

Next Microsoft’s Julie Larson-Green and Michael Angiulo came on to show off a few details about the Windows 8 user interface, followed by Ballmer who gave what is for him a muted address about how great Windows 8 is going to be. Solid facts were few, but Microsoft did mention that over 1000 devices are certified for Windows 8.

So what is Windows 8 all about? It’s a tablet, it’s a laptop, it’s a PC we were told, in other words, everything. But everything is also nothing, and my sense is that even Microsoft is struggling to articulate its message, or at least, struggling to do so in ways that would not offend key partners.

Personally I like Windows 8, I find it perfectly usable and appreciate the convenience of the tablet format. That said, I look at all these hybrid devices and my heart sinks: these are devices that are neither one thing nor another, and pay for it with complexity and expense. Will they win over users who might otherwise have bought a MacBook? I am doubtful.

Windows RT and Intel Atom devices are more interesting. If Microsoft and its partners can push out Windows 8 devices that inexpensive and work well on tablets without keyboard clutter, that is what has potential to disrupt the market.

That brings me on to Surface. It is all in the body language: the conviction that was missing from the Windows 8 keynote in the morning was present in the Surface keynote in the afternoon. Even the room was better, with stylish Surface fake pavement art in the corridor and smart white seating.

image

General Manager Panos Panay showed off little details, like the way the rear camera angles so that it is level when the Surface is set on its kickstand. He talked about Microsoft’s drop tests, claiming that they had tested 72 different ways to drop a Surface and designed it not to break. He demonstrated this by dropping it onto a carpet, which was not too challenging, but the fact that Sinofsky successfully used it as a skateboard was more impressive.

image

No doubt then: Microsoft has more enthusiasm for Surface, described by Panay as “the perfect expression of Windows”, than it does for the 1000 certified devices from its partners, though the company would never admit that directly.

What is the significance of Surface? It goes beyond the device itself. It will impact Microsoft’s relationship with its hardware partners. It embodies an Apple-like principle that design excellence means hardware designed for software designed for hardware. It shows that the “OK but nothing special” approach of most Windows hardware vendors is no longer good enough. If Surface is popular, it will also introduce demand for more of the same: a 7” Surface, a Surface phone, and more.

Despite its quality, the success of Surface is not assured. The biggest problem with Windows 8 now is with the lack of outstanding apps. That is not surprising given that the platform is new, and you would think that users would make allowance for that. On the other hand, they may lack patience and opt for better supported platforms instead, in which case building app momentum will be a challenge.

ITWriting app hits the Windows 8 store

Hands on where possible is part of my technical journalism philosophy, so I have been trying out Windows 8 development for some time. After playing around with and adapting Microsoft’s blog reader sample I decided to take it further and try submitting it to the Windows 8 Store.

Today it was certified so you can install it now. It is free of course. 

image

There is not much to it. It features quick access to recent posts on itwriting.com and gadgets.itwriting.com, recent tweets, and dedicated links to Windows 8 survival guides for both keyboard/mouse and touch/tablet users.

Despite its simplicity, creating the app was an interesting exercise. Having the app layout change in a moderately sensible way when switched between portrait and landscape, and filled or snapped, taught me a bit about XAML and the VisualStateManager element. I also struggled a bit with the flyouts that you use to implement app settings, the ones that appear when the user displays the Charms menu and taps or clicks Settings when your app has the focus. I used the official sample though I discovered that it will not compile as-is because the standard brush names have changed since the release preview for which the sample was apparently created. I have have some sort of z-order bug there which I have not yet solved.

Creating apps for Windows 8 is not difficult exactly, but it is fiddly. It seems to me harder than, for example, creating a desktop app using Windows Forms. In mitigation, setup and deployment is done for you which is a significant advantage. I was also pleased to discover that the app works fine on a Surface RT.

image

The Windows Store certification process was rather straightforward in my case; the app passed first time. I had noticed from other reports that having a privacy policy in place is important, so made sure that this is linked in this settings.

I do have some ideas for making the app a little more interesting. Share support and offline support would be obvious enhancements. Watch out for future updates!

Windows 8 FAQ: the real Frequently Asked Questions

Since there is a certain amount of puzzlement around concerning Microsoft’s new version of Windows, or I should say, two new versions of Windows, here are the answers to the questions many are asking.

Why is Windows 8 so odd?

Windows is the most popular desktop operating system in the world; but is on a trajectory of slow decline. A combination of Macs at the high end and iPad or Android tablets in mobile is eroding its market share. You might not mind that, but Microsoft does, and Windows 8 is its answer. It has a tablet personality which is Microsoft’s tablet play, and a desktop personality which lets you run your existing Windows applications. The two are melded together, which makes Windows 8 a little odd, but ensures that neither one will be ignored.

Why did Microsoft not make a separate tablet version of Windows, like Apple’s iOS and OSX?

Many users think Microsoft should have made the tablet personality in Windows 8 a separate operating system. However, when they say that this would have made more sense and be less odd and intrusive, what they mean is that if it were a separate operating system they could ignore it and get on with their work in old-style Windows. That would achieve nothing for Microsoft, since the tablet-only OS would fail in the market.

Furthermore, Microsoft did in fact make a separate tablet version of Windows. It is called Windows RT (see below).

Why did Microsoft make the desktop side of Windows 8 impossible to use without touch input?

Actually it is fine to use with keyboard and mouse, it just takes some getting used to. When people say it is impossible to use, they mean that they have only tried it for five minutes in a virtual machine and did not like it. If you stick at it, you discover that Microsoft actually thought hard about keyboard and mouse users, and that the new Start screen is a better application launcher than the old Start menu, particularly in combination with the most used applications pinned to the taskbar. Some will not get that far, in which case they will stick with Windows 7 or even buy Macs. That is Microsoft’s calculated risk.

Why didn’t Microsoft simply make desktop Windows easy to use with touch input?

Microsoft tried, in Tablet PC and in Windows 7, but could not make it work. The biggest problem is that while Microsoft conceivably could have made the Windows desktop work well with touch input alone, it had no chance of fixing third-party applications, or older versions of Microsoft’s own software like Office.

Why did Microsoft remove the Start menu from the desktop?

This was not just to annoy you; but Microsoft would rather risk annoying you than have the new app platform in Windows be ignored. That said, there are third-party utilities that put something very like the Start menu back on the desktop if you prefer.

Why is the tablet side of Windows 8 locked down so you can only install apps from the Store?

Well, there are ways. But Microsoft observed Apple’s success with this model on the iPhone and iPad. Easy app discovery, no malware, and a stream of income from third-party sales. Aiming for lock-down was an easy decision; but the Intel version of Windows 8 will never be truly locked down.

Why are the apps in the Windows Store so few and so poor?

This is because the tablet personality in Windows 8 is a new and unproven platform. Software vendors and app developers are not sure whether it will succeed; and they are busy making apps for the two tablet platforms that already have a market, iOS and Android. If Windows 8 takes off, then the apps will start to flow. Unfortunately, the poor quality of the apps so far makes that less likely. Microsoft is countering by seeding the market with a few high quality apps, like OneNote MX, and hoping that Windows 8 users will create a strong demand for apps as the operating system becomes well-known.

What is Windows RT?

Windows RT is Windows 8 running on the ARM processor. The difference from the user’s perspective is that only new-style tablet apps will run on Windows RT. Your existing Windows apps will not run. It is not all bad news though. A Windows RT tablet or notebook will be more secure and run more efficiently than Windows 8 on Intel. If Microsoft has done its job, it should be more stable too, since apps are isolated from each other and from the operating system. Another bonus is that Windows RT comes with Microsoft Office bundled for free – though business users should beware of licensing issues which prohibit commercial use, unless you have an additional license to use Office.

Why are there so few Windows RT devices?

Microsoft’s third-party partners are not sure that Windows RT will succeed. They are a conservative bunch, and think that users will prefer compatibility with the past over the advantages in security, efficiency, and usability with touch, that Windows RT offers.

Why are most Windows 8 tablets complex and expensive hybrids with twisty screens and keyboards?

See above. Most of Microsoft’s hardware partners are not sure that users will buy into the idea of using Windows with simple touch-only slates, so they are playing safe, as they think, with hybrid devices that can be used either as slates or like laptops. Unfortunately the high price of such complex devices will limit demand. Microsoft is doing its own devices, called Surface, as examples of hardware that shows off Windows 8 to best advantage.

Should I upgrade to Windows 8?

If you don’t mind trying something new, yes. It runs better than Windows 7 in most respects. Yes, it is a little odd and has some annoyances, but nothing too serious. Give yourself a little time to learn it. If you hate change though, stick with what you like.

Will Windows 8 succeed, or is it the beginning of the end for Windows?

Ask me that a year from now. Let me add though, that the thing to watch is the Windows Store. If the Store flourishes and quality apps start to flow, it is working. If not, then Microsoft will have failed to achieve its goal with Windows 8, which is to establish a new app ecosystem.

See also:

Windows 8 survival guide for keyboard and mouse users

Windows 8 survival guide for tablet and touch users

Microsoft posts decline in revenue and profits on the eve of Windows 8 launch

Microsoft has announced its results for the first quarter of its financial year. The quote from Chief Financial Officer Peter Klein sums it up pretty well:

While enterprise revenue continued to grow and we managed our expenses, the slowdown in PC demand ahead of the Windows 8 launch resulted in a decline in operating income

Except that is for one thing. Klein implies that the PC slowdown is something to be expected ahead of the launch of a new edition of Windows, but I suggest there is more to it than that. First though, here are the figures, in the summary form that I have used before:

Quarter ending September 30th 2012 vs quarter ending September 30th 2011, $millions

Segment Revenue Change Profit Change
Client (Windows + Live) 3244 -1630 1646 -1624
Server and Tools 4552 +336 1748 +183
Online 697 +56 -364 150
Business (Office) 5502 -133 3646 -71
Entertainment and devices 1946 -15 19 -321

What is notable here is a significant reduction in revenue from the Windows client, while the enterprise-focused server and tools continue to grow. The Office products are bumping along fine, despite a small reduction in revenue, and despite the fact that we are on the eve of a new edition of Office as well as Windows.

Note that I am not a financial analyst, so take the following observations in that light.

I suggest that falling revenue from the Windows client is not just because Windows 8 is on the way, but because of a shift in the market towards mobile and tablets – Apple iPad and Google Android devices. See this post for an example of that in the consumer market.

Will Windows 8 deliver the hoped-for boost in PC and Windows sales? I am sceptical, especially in the short term (in other words, the next quarter). I discussed some of the issues here. Microsoft is making radical changes both to Windows and to its business model. It is doing the right thing, bringing Windows into the tablet era, and venturing into Windows device manufacture in order to pull quality of hardware design into its own hands rather than trusting entirely to OEM partners.

That transition may or may not work long-term, but in the short term it is likely to be costly. In Windows 8 Microsoft has concentrated on establishing a new ecosystem around the new tablet-friendly Windows Runtime platform. The consequence is that it does not deliver much benefit to users of desktop applications – in other words, all Windows applications other than those in the new Windows app store. Further, moving to Windows 8 is difficult at first for those familiar with Windows, so much so that many users react against it.

This means that Windows 8 will not deliver the upgrade rush that Windows 7 enjoyed, following on from the unpopular Vista. Rather, its success rests on the new elements in Windows: tablet use and Windows 8 apps.

Right now though, there is very little in the Windows Store that is good enough to drive sales. Developers are waiting to see if the platform succeeds before diving in.

The Windows 8 platform does have plenty of potential; and Microsoft is putting a huge promotional push behind it. Against that, there are powerful forces that will tend to suppress demand. It is going to be a battle, and one for which the outcome is hard to predict.

Amazon.com sales stats snapshot shows why Microsoft is reinventing Windows

Anyone who questions the need for Microsoft’s radical reinvention of Windows need look no further than Amazon’s sales stats.

I was on Amazon.com checking out the specs for Samsung’s new Ativ slate, and happened to click the link for best sellers in Computers and Accessories.

On the morning of 17th October 2012, here is how the top 20 looked:

  • Six Android tablets including Samsung Galaxy Tab at number 1 and Google Nexus 7 at 3
  • Four varieties of Apple iPad at number 4, 7, 9 and 13
  • Two Apple MacBooks (Pro and Air) at positions 2 and 16
  • One solitary Windows laptop at number 10 (Dell Inspiron).

A mix of networking devices, screens and accessories make up the other eight places; I chose the entire sector because it puts tablets and laptops alongside each other.

image

This is not about price. That Dell laptop is $429.99, little different from the 16GB iPad 2 at $399.99 and 42.5% of the cost of the MacBook Pro.

Windows still outsells the Mac overall. Gartner gave Apple just 13.6% of the US PC market (excluding tablets) for the third quarter of 2012. However, Windows is boosted by large corporate sales, where the Mac is still a minority taste; Amazon is largely a consumer vendor.

Further, Amazon’s figures change hourly and I may have hit a low spot; check out the current list yourself.

Finally, the large number of Windows laptops on offer dilute the ranking of any one – though there are a lot of Android tablets on sale too.

For Microsoft though, this is still a worrying list to see. Today’s Windows 7 devices are not what consumers want. Reinventing Windows for tablets was the right thing to do – though that does not, of course, prove that Windows 8 will succeed. Windows 8 pre-orders are not high on the list either – and yes, they are on the list; the Samsung Ativ convertible is currently at 60.

Microsoft Surface is coming: Windows, but not as you know it

Today Microsoft showed full details and prices for its Surface RT tablet with an ARM processor – an Intel variant is to follow – and you can order now.

image

Surface is a distinctive device. Here are the key points:

  • Surface RT runs an NVidia ARM chipset – which means not one of your existing Windows 7 or earlier apps will run. Only new Windows Store (Metro-style) apps can be installed.
  • Microsoft Office 2013 comes preinstalled. It is the Home and Student edition, no Outlook and no license for commercial use, though individuals who use it for work are unlikely to be pursued. Businesses will need to cover Office usage with a volume license.
  • This is a true tablet. There are two different styles of keyboard cover, but it is designed for touch control. How successful this is for Office is moot (and we have not yet seen the final Office 2013) but it should at least be tolerable.

I doubt you will buy Surface RT for its specs: not bad, but not special either:

  • 10.6″ 1366 x 768 display (no Retina claims here)
  • 5-point multitouch
  • 2GB RAM
  • 1.5lbs weight – pretty lightweight
  • Wifi and Bluetooth but no 3G or 4G
  • Front and rear 720p cameras
  • Two microphones, stereo speakers
  • USB 2.0 (not 3.0)
  • MicroSDXC card slot (a nice differentiator from the Apple iPad)
  • 32GB or 64GB built-in storage
  • HD video out
  • Sensors: ambient light, accelerometer, Gyroscope, Compass
  • Estimated 8 hour battery life – a bit disappointing, but decent

On the plus side, this should be the most reliable Windows yet. With desktop application installs blocked and only sandboxed Windows Runtime apps allowed, there is little opportunity for badly behaved applications or OEM foistware to foul up the system.

Surface RT realises the Windows 8 vision more fully than the Intel models, which are less efficient, less secure, and odd hybrids of old and new Windows. There is still a desktop in Surface RT, but it is limited and it would not be surprising if it disappears in future versions.

This means that Surface RT is in some respects better than the x86 Surface Pro which is promised at a later date. Surface Pro is heavier (up to 2lbs total), more power hungry, does not come with Office bundled, and will not be as secure. Further, Surface Pro will have greater need of keyboard and mouse thanks to those old desktop applications that users will install. I know which one I would rather take on a plane.

The problem with Surface RT: the Windows Store currently has around 3000 apps, most of them trivial and/or poor. How viable is Surface RT right now for getting all your work done when on the road?

That is an open question, and makes this a risky purchase for most users right now.

Then again, with Office, a web browser and a remote desktop client you are covered for many needs.

As the Windows 8 app ecosystem matures, Surface RT will get correspondingly more attractive. If Microsoft has got the design right (and early reports are good) this could be the ideal device for work and play. I want one.

Adapting the Items Page template in a Windows Runtime app

A while back I adapted a sample application in order to create an app for Windows 8. I am mulling over putting it in the Windows Store, but it needed some work. In particular, I wanted to add a Twitter feed to the front page. There is plenty of space:

image

Sounds easy; but inspecting the layout code I realised that I did not understand it all that well at first.

It is based on the Items Page template in Visual Studio 2012, and there is a fair amount going on in that template:

image

  • The contents are data-bound, which is great at runtime but inconvenient at design time as the page is empty.
  • The contents are layout-aware which means that they account for the four views possible in a Windows Runtime app: landscape, portrait, snapped, and filled. The “filled” name is a little misleading; this is an app which occupies most (but not all) of the screen when another app is snapped to one side.
  • The page uses resources and templates for its element styling, which are defined either in the page itself, or in StandardStyles.xaml which resides in the Common folder in your project (added automatically in projects which use the ItemsPage template).

It’s worth adding some dummy data early on so you can see what the page really looks like:

image

For example, imagine that you want to use a smaller item size that the default 250 x 250 size. Proceed as follows:

  1. Copy the DataTemplate called Standard250x250ItemTemplate from StandardStyles.xaml. Place it in the Page.Resources section of ItemsPage1.xaml (or whatever you called your ItemsPage). Rename it to, say, “MyItemTemplate”.
  2. Modify it to use a smaller size. You will probably want to adjust the bound elements as well, plus change the references to the standard Brush elements like  ListViewItemPlaceholderBackgroundThemeBrush as well.

Here is how the page looks with the space for the image removed, the DataTemplate height set to 50, and the height of the bound Title field set to 20:

image

Note that this template is not used by the Snapped view. For that, you will need to copy and modify the Standard80ItemTemplate, or make your own template suitable for an item in the Snapped view.

The code that determines which templates are used in which state is in the VisualStateManager.VisualStateGroups element. This has a Storyboard animation for the Portrait and Snapped views. The way this works:

  1. The default view is landscape. This is why in the XAML there is a GridView called itemGridView which is visible, and a ListView called itemListView which is hidden (Visibility="Collapsed").
  2. In the Snapped view there is only room for a single-column list, not the grid. Therefore the Storyboard for the Snapped view sets the itemListView to visible and the itemGridView to hidden.
  3. When you change back to a non-Snapped landscape view, the layout reverts to the default. Code for this in in LayoutAwarePage.cs, also in the Common folder.

After working this out I was better able to adapt my own page. More on that another time!