"Think you've mastered the art of server performance? Think again." Poul-Henning Kamp recently published this article with the quote, which basically says that a binary-heap tree structure is inefficient and should not be used. Poul-Henning (PHK) has recently spent more of his spare time on blogging and making his views known to the public, and he writes articles that often spark great debates.
In this particular case, PHKs knowledge about virtual memory and high performance in cache-intensive applications makes him complain that so many fellow programmers consider a binary tree in memory efficient. However, the counter-argument is that this is known knowledge among algorithm experts, and some actually complain that PHK's article was published in ACM despite of that.
However, how many of you have attended an algorithm conference lately in order to get updated with the latest news? Probably not many. And even if you dig into algorithm science, the sheer number of algorithms for rare cases is overwhelming. PHKs article may not benefit many directly. Many programmers don't use much RAM, develop in frameworks that anticipate that there is more physical RAM than needed (Java, .net), or don't want to invest time into extra performance. But it does illustrate how programmers should innovate their algorithms while solving problems, and the article definitely applies to Delphi programming.
Many great things were achieved because somebody tried to do things just a little better.
Thursday, 17 June 2010
Monday, 24 May 2010
Sandboxed vs. Trust, sandboxing wins
One of the most basic principles on Windows, in order to prevent malware, is that you trust your software provider. There are many trust mechanisms, including driver signing, website signing, remembering whether a file was downloaded or was produced locally etc. The idea is, that if you can trace the origin of the file, you can make the provider liable. If you need to break the trust chain, for instance if you download an unsigned setup.exe file that you want to install, you need to confirm that you want to do that.
On the other hand, we have sandboxing techniques. JavaScript originally had a lot of access to the local browser, for instance, one web page could access info from another web page. Obviously, this had to be changed, each untrusted web page must be isolated from other web pages. Google Chrome even added a second sandboxing layer inside the code, so that if there are bugs in the JavaScript API implementation, the JavaScript could probably not break through the second layer. This has given Google Chrome a very good security record. Other IT technologies also implement sandboxing or are in effect sandboxing: virtual machines, managed code. Google NaCl can also be considered a kind of sandboxing, although it's basically native code "at least as safe as javascript".
Web apps have grown to be extremely popular, despite being expensive to develop and often with low usability. The main reason is that they are very simple to deploy: you don't need to install anything and it works everywhere, and data is saved on the server. This is not entirely true: You need to install an adequate browser, which means that it doesn't work everywhere, and even server/client software often only stores data on the server. So, why are web apps different?
Here is the key: Web apps are usually much easier to install/configure, and you can use web apps from untrusted sources.
Both iPhone and Android solved these parameters for local apps: It is almost easier to install an app than to bookmark a good web app, simply because the search for a good app is guided using the app store/market, and installation is as simple as bookmarking a web page. Using software from untrusted sources is handled using sandboxing. I have no idea if the provider of my currency exchange rate app is evil or not, but it cannot access anything except the internet connection, so it cannot be used to wiretap on me. I am completely sure that it will not know my location, for instance. Android Market still requires signatures, but it does not need to be a signature with trust - the security is in the sandbox.
In addition to being at least as easy as web apps, iPhone and Android apps provide better usability because they are designed for the user interface hardware, and they provide better functionality because they can work offline and with access to hardware, if you permit it.
Most Android and iPhone users that I know, have more apps installed on their phone than on their computer. The reason is not that the apps on the phone are smaller - but there is an inherent problem with Windows app: If you don't trust them, you won't install them on a computer that needs to be safe. Many IT departments lock down Windows computers so that you cannot install anything. Many employees in large organizations don't have the possibility to install even small simple apps, so web apps are their only choice - the browser is the only widespread sandboxing system on Windows.
The future is sandboxed.
On the other hand, we have sandboxing techniques. JavaScript originally had a lot of access to the local browser, for instance, one web page could access info from another web page. Obviously, this had to be changed, each untrusted web page must be isolated from other web pages. Google Chrome even added a second sandboxing layer inside the code, so that if there are bugs in the JavaScript API implementation, the JavaScript could probably not break through the second layer. This has given Google Chrome a very good security record. Other IT technologies also implement sandboxing or are in effect sandboxing: virtual machines, managed code. Google NaCl can also be considered a kind of sandboxing, although it's basically native code "at least as safe as javascript".
Web apps have grown to be extremely popular, despite being expensive to develop and often with low usability. The main reason is that they are very simple to deploy: you don't need to install anything and it works everywhere, and data is saved on the server. This is not entirely true: You need to install an adequate browser, which means that it doesn't work everywhere, and even server/client software often only stores data on the server. So, why are web apps different?
Here is the key: Web apps are usually much easier to install/configure, and you can use web apps from untrusted sources.
Both iPhone and Android solved these parameters for local apps: It is almost easier to install an app than to bookmark a good web app, simply because the search for a good app is guided using the app store/market, and installation is as simple as bookmarking a web page. Using software from untrusted sources is handled using sandboxing. I have no idea if the provider of my currency exchange rate app is evil or not, but it cannot access anything except the internet connection, so it cannot be used to wiretap on me. I am completely sure that it will not know my location, for instance. Android Market still requires signatures, but it does not need to be a signature with trust - the security is in the sandbox.
In addition to being at least as easy as web apps, iPhone and Android apps provide better usability because they are designed for the user interface hardware, and they provide better functionality because they can work offline and with access to hardware, if you permit it.
Most Android and iPhone users that I know, have more apps installed on their phone than on their computer. The reason is not that the apps on the phone are smaller - but there is an inherent problem with Windows app: If you don't trust them, you won't install them on a computer that needs to be safe. Many IT departments lock down Windows computers so that you cannot install anything. Many employees in large organizations don't have the possibility to install even small simple apps, so web apps are their only choice - the browser is the only widespread sandboxing system on Windows.
The future is sandboxed.
Saturday, 24 April 2010
How Android beats Windows 7 laptops
Lately, many have started to use their phone for tasks, for which they previously used a PC - including updating online spreadsheets etc. The PC features much better input and output devices (keyboard, mouse, screen), so why use the phone for these tasks? Here is a list of why it makes sense to use an typical Android phone instead of a Windows 7 laptop for many tasks:
* The laptop does not have built-in GPS, so location information cannot be used to assist tasks by searching locally, looking up addresses, providing context-dependent functionality etc.
* The laptop does not have a log over what has been done lately while away from the PC. So it does not know who the user has been talking to, where the user has been driving, which destinations/shops the user has looked up etc.
* The laptop cannot easily exchange information via SMS or MMS, so in order to quickly exchange a link to someone that you have just been talking to, things become a lot more complicated than if you just grab your android phone.
* The phone is always turned on and online. This means that some tasks are usually done on the phone, and even if the laptop should be online, it is easier to keep with the usual way of doing things.
* Both devices have reflective screens, but it is much easier to avoid reflections on the phone, because the laptop is more restrictive on work positions.
* It is much easier to take a picture of a piece of paper using the phone than a laptop's built-in webcam, besides the fact that the webcam usually does not have an adequate resolution. This means that some information simply starts being created on the phone, not on the PC.
* Windows does not have a market place that makes it easy to find productivity enhancing apps - and installing software on Windows is much more tedious, too.
* Windows does not sandbox applications. If you install the whiteboard photo & filtering & email app on Android, it cannot access your files, but it is not easy to prevent file access for a similar app for Windows.
* The laptop does not have built-in GPS, so location information cannot be used to assist tasks by searching locally, looking up addresses, providing context-dependent functionality etc.
* The laptop does not have a log over what has been done lately while away from the PC. So it does not know who the user has been talking to, where the user has been driving, which destinations/shops the user has looked up etc.
* The laptop cannot easily exchange information via SMS or MMS, so in order to quickly exchange a link to someone that you have just been talking to, things become a lot more complicated than if you just grab your android phone.
* The phone is always turned on and online. This means that some tasks are usually done on the phone, and even if the laptop should be online, it is easier to keep with the usual way of doing things.
* Both devices have reflective screens, but it is much easier to avoid reflections on the phone, because the laptop is more restrictive on work positions.
* It is much easier to take a picture of a piece of paper using the phone than a laptop's built-in webcam, besides the fact that the webcam usually does not have an adequate resolution. This means that some information simply starts being created on the phone, not on the PC.
* Windows does not have a market place that makes it easy to find productivity enhancing apps - and installing software on Windows is much more tedious, too.
* Windows does not sandbox applications. If you install the whiteboard photo & filtering & email app on Android, it cannot access your files, but it is not easy to prevent file access for a similar app for Windows.
Subscribe to:
Posts (Atom)