Online Store | About Us | Blog
Page 1 of 5 in the NET category Next Page
# Tuesday, August 24, 2010




Performance - Why Not to Upgrade

Are you a developer thinking of upgrading your PC? I have a very good reason for you not to upgrade.

It boils down to one thing: testing.

If you want to test your application from the user's perspective, especially from the lowest common denominator user's perspective, then your PC configuration needs to match those specs. If you have a top-notch PC that only 2% of your users have, guess what: 98% of your users will perceive your application as being "slow."

Rule of Thumb: 90th Percentile

Since you don't want to give your users the perception that your apps are slow, always match the 90th percentile of what your users are likely to have. So for example, if 90% or more of your users have at least 256 MB of RAM, then your development machine should have only 256 MB of RAM.

It turns out that about 90% of my users have dual-core CPUs (not quad core or single core) and at least 2 GB of RAM. They also have a video card that generally gets at least 30 TTP/s in the 3D test. My current dev PC is about twice those specs. It is a dual-core Intel Core 2 Duo E8400 with 4 GB RAM, and it gets around 70 TTP/s in the 3D test. It is a bit more powerful than I want it to be, and I will certainly not be upgrading it for a while.

When I developed Dacris Benchmarks 5.0, in late 2001, I did so on an Athlon 1 GHz machine with only 256 MB of RAM. That became roughly the 90th percentile PC spec in early 2002 (for power users). I also had to target Windows 98 and Windows 2000 at the time. I had to set up virtual machines in VMWare to test those OSes, since I was already running Windows XP.

I have basically been following the 90% rule for at least 9 years, mostly not by choice - since I did not have the lavish budget to spend on the latest & greatest hardware. However, in the past 2 years I have been consciously following this rule and if anything it has given me a great excuse not to spend too much money on upgrades.

Going Against the Rule: Windows Vista, .NET

An infamous example of not designing for the 90th percentile can be seen with Windows Vista. In early 2007, the 90th percentile configuration was quite out of reach of the system requirements imposed by Vista. Keep in mind that Windows has to run on all kinds of PCs. Also, Vista is not like Dacris Benchmarks where users are knowledgeable about hardware and usually have more powerful hardware than your average PC user. Bottom line - the jump from XP's basic 64 MB RAM requirement to Vista's 1 GB was too much for mainstream PC users. The result - Vista never reached more than 19% market share!

And if you still doubt that performance matters, take a look at how slow the adoption of .NET has been. .NET is much more resource-hungry than "raw" C++. It requires lots of memory to do JIT compilation. You can hardly run a .NET app without major disk thrashing on less than 512 MB of RAM. That is part of the reason why .NET adoption did not really begin until late 2004. I remember the JVM (Java Virtual Machine) being extremely slow (again due to insufficient RAM) even as late as 2005.

Stick to a $2000 Budget

My advice to those thinking of building a super-ultimate beast for a development box: don't. Try to spend less than $2000 on your beast. Otherwise, you'll be living in an elite fantasy world, isolated from the real world inhabited by most PC users. Note - if your users are super-power users, then the $2000 budget is trumped by the 90th percentile rule. Always try to match the 90th percentile.

If, on the other hand, you want to do R&D, by all means go for the latest & greatest hardware. It is the best way to stay ahead of the game and develop ideas for software that will only be commercially viable in 3+ years. It is a great idea as part of a larger R&D strategy to have at least one "R&D beast" machine. However, you should never do real "production" development on your R&D beast.

Conclusions

Development (for your products) should always be confined to your 90th percentile configuration, so that performance is accurately modeled for 90% of your users. Otherwise, you may have a surprise when your users start complaining about performance issues.

It is far too easy to become tempted to write slow code if, on your PC, the slow code isn't really slow. Even if you plan to test your software on other (slower) PCs, the time you spend during that testing may not be enough to give you a solid feel for how your users will perceive your software. And even if you do spend enough time testing your software on slower PCs, if you catch performance issues at that late a stage in development, the effort necessary to correct them is much greater than if you simply designed your software for that PC configuration in the first place.

August 24, 2010 12:02 PM Eastern Daylight Time  #    Comments [0] - Trackback
.NET | Business | Commentary | History | Technology | Tips
# Wednesday, August 18, 2010




Announcing Vmana Beta Program

Today, the world of search is one step closer to revolution.

Vmana - the cloud-based commerce search engine - is entering beta on September 1, 2010. Starting today, we are accepting requests from users who wish to participate in the beta program.

The Vmana beta program is expected to run for at least two months. We plan to accept up to 200 beta testers; no more.

What is Vmana?

In a nutshell, Vmana is a hosted e-commerce search engine.

It supports filtering, facets, XML feeds, and all of the other bells & whistles of a top notch search engine.

It is fully managed, with a 100% up-time SLA (service level agreement).

Being a hosted solution, performance never suffers. We always grow capacity behind the scenes to meet demand.

Why is it a revolution?

Quite simply, this has never been done before. Especially not on the scale that it is about to be done.

As the cost of computing continues to decline exponentially (at a rate of ~40% per year), the time for providing high-level software APIs in the cloud is growing ever closer to the present. Vmana is one such example: a high-level search API sitting in the cloud.

Up until now, cloud computing has centered around the idea of providing low-level services (such as queues, storage, or CPU) to the user. This is akin to the days of time-sharing computers and dumb terminals.

The key to the future of cloud computing lies in the ability to provide high-level services (such as search). This is only recently becoming possible. Just as the evolution from the command line to the GUI required a certain critical performance level to be reached, we are now on the cusp of a major transition in cloud computing, from low-level "dumb" APIs to high-level "smart" APIs.

Vmana is a high-level API, which is why it is called "intelligent" search. That's why it's a revolution.

How is it being done?

Behind the scenes lies Lucene - a powerful open-source search engine. However, Lucene is just a tiny fraction of Vmana.

Vmana consists of a crawler, a search engine, and a management & administration dashboard.

Key features include: on-demand and automatic crawling, comprehensive logging, XML feed support (for input), XML search results, REST-style API, and more.

Why cloud?

There are several key advantages to cloud computing in general:
  • Guaranteed performance.
  • Guaranteed reliability.
  • You only pay for what you use.
  • Easy setup and deployment.
These are the advantages of Vmana over, say, an enterprise search appliance like the GSA (Google Search Appliance).

Why not a "bare bones" search engine like Lucene?

There are several disadvantages to doing that:
  • Steep learning curve.
  • Integration effort is costly.
  • Maintenance is difficult (often requires dedicated staff).
  • No analytics or reporting features.
The better question is - why live with those disadvantages?

Conclusion

A hosted search solution really makes sense when you take into account all of the disadvantages of the alternative solutions.

For those willing to try something new, it may be worthwhile to sign up for the Vmana beta program or learn more about Vmana.

Note - we are only accepting 200 beta testers in total.

August 18, 2010 3:43 AM Eastern Daylight Time  #    Comments [0] - Trackback
.NET | Business | Commentary | News | Search | Technology
# Saturday, July 31, 2010




C# Serializable Dictionary - a Working Example

Here is the example:

using System;
using System.Runtime.Serialization;
using System.Xml;
using System.Xml.Serialization;
using System.Collections.Generic;
using System.Text;

[Serializable()]
public class SerializableDictionary<TKey, TVal> : Dictionary<TKey, TVal>, IXmlSerializable, ISerializable
{
        #region Constants
        private const string DictionaryNodeName = "Dictionary";
        private const string ItemNodeName = "Item";
        private const string KeyNodeName = "Key";
        private const string ValueNodeName = "Value";
        #endregion
        #region Constructors
        public SerializableDictionary()
        {
        }

        public SerializableDictionary(IDictionary<TKey, TVal> dictionary)
            : base(dictionary)
        {
        }

        public SerializableDictionary(IEqualityComparer<TKey> comparer)
            : base(comparer)
        {
        }

        public SerializableDictionary(int capacity)
            : base(capacity)
        {
        }

        public SerializableDictionary(IDictionary<TKey, TVal> dictionary, IEqualityComparer<TKey> comparer)
            : base(dictionary, comparer)
        {
        }

        public SerializableDictionary(int capacity, IEqualityComparer<TKey> comparer)
            : base(capacity, comparer)
        {
        }

        #endregion
        #region ISerializable Members

        protected SerializableDictionary(SerializationInfo info, StreamingContext context)
        {
            int itemCount = info.GetInt32("ItemCount");
            for (int i = 0; i < itemCount; i++)
            {
                KeyValuePair<TKey, TVal> kvp = (KeyValuePair<TKey, TVal>)info.GetValue(String.Format("Item{0}", i), typeof(KeyValuePair<TKey, TVal>));
                this.Add(kvp.Key, kvp.Value);
            }
        }

        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue("ItemCount", this.Count);
            int itemIdx = 0;
            foreach (KeyValuePair<TKey, TVal> kvp in this)
            {
                info.AddValue(String.Format("Item{0}", itemIdx), kvp, typeof(KeyValuePair<TKey, TVal>));
                itemIdx++;
            }
        }

        #endregion
        #region IXmlSerializable Members

        void IXmlSerializable.WriteXml(System.Xml.XmlWriter writer)
        {
            //writer.WriteStartElement(DictionaryNodeName);
            foreach (KeyValuePair<TKey, TVal> kvp in this)
            {
                writer.WriteStartElement(ItemNodeName);
                writer.WriteStartElement(KeyNodeName);
                KeySerializer.Serialize(writer, kvp.Key);
                writer.WriteEndElement();
                writer.WriteStartElement(ValueNodeName);
                ValueSerializer.Serialize(writer, kvp.Value);
                writer.WriteEndElement();
                writer.WriteEndElement();
            }
            //writer.WriteEndElement();
        }

        void IXmlSerializable.ReadXml(System.Xml.XmlReader reader)
        {
            if (reader.IsEmptyElement)
            {
                return;
            }

            // Move past container
            if (!reader.Read())
            {
                throw new XmlException("Error in Deserialization of Dictionary");
            }

            //reader.ReadStartElement(DictionaryNodeName);
            while (reader.NodeType != XmlNodeType.EndElement)
            {
                reader.ReadStartElement(ItemNodeName);
                reader.ReadStartElement(KeyNodeName);
                TKey key = (TKey)KeySerializer.Deserialize(reader);
                reader.ReadEndElement();
                reader.ReadStartElement(ValueNodeName);
                TVal value = (TVal)ValueSerializer.Deserialize(reader);
                reader.ReadEndElement();
                reader.ReadEndElement();
                this.Add(key, value);
                reader.MoveToContent();
            }
            //reader.ReadEndElement();

            reader.ReadEndElement(); // Read End Element to close Read of containing node
        }

        System.Xml.Schema.XmlSchema IXmlSerializable.GetSchema()
        {
            return null;
        }

        #endregion
        #region Private Properties
        protected XmlSerializer ValueSerializer
        {
            get
            {
                if (valueSerializer == null)
                {
                    valueSerializer = new XmlSerializer(typeof(TVal));
                }
                return valueSerializer;
            }
        }

        private XmlSerializer KeySerializer
        {
            get
            {
                if (keySerializer == null)
                {
                    keySerializer = new XmlSerializer(typeof(TKey));
                }
                return keySerializer;
            }
        }
        #endregion
        #region Private Members
        private XmlSerializer keySerializer = null;
        private XmlSerializer valueSerializer = null;
        #endregion
}


The full C# file can be downloaded here: SerializableDictionary.cs

This class is both XML-serializable and binary-serializable. It is hard to find examples out there that do both.

July 31, 2010 2:42 AM Eastern Daylight Time  #    Comments [0] - Trackback
.NET | News | Personal | Technology | Tips
# Friday, July 23, 2010




WCF – A Gigantic Monstrosity from the Depths of Hell

So it seems everyone out there who wants to create REST services is using WCF to do it. I don’t know how this trend got started, but it’s wrong. You see, WCF was never made for the web. It was made to replace inter-process communication which used to be done through RPC. Then, it grew into a bloated Swiss-army-knife solution trying to solve all of the world’s problems, including (as it happens) REST. Sure it solves the problem, but not very well. Only if you accept the gigantic limitations that WCF imposes on you.

Trying to build a REST service with WCF is like trying to open a beer bottle with explosives. It will open, but then you’ve got a whole mess on your hands.

This week I’ve been struggling to do exactly that – set up a REST service with WCF. Given that I have shared web hosting (I know, poor old me) and have multiple sub domains hosted on the same IIS service, it proved to be impossible. The error: “This collection already contains an address with scheme http.”

Looking around on the web for a solution proved to be futile. It appears that unless you have a dedicated IIS instance just for your WCF REST service, it ain’t gonna happen.

Another thing that really makes my blood boil with WCF is the fact that tracing is so difficult. You have to use a proprietary tool to view a proprietary trace format – and that’s when you finally get it to work right. If you can’t get it to work (I couldn’t), the result is that you try to access one of your service methods and, if there's something wrong with the method, you only get a blank browser screen. No debug output, no exception message, nothing.

I then realized there’s a much easier way to make it happen. The answer is so staggeringly simple you will laugh…

Global.asax

Here’s how you do it:
  1. Take out all the WCF junk from the web.config. God knows WCF likes to flood you with configuration.

  2. Add one line to Global.asax.cs, in Application_BeginRequest:
    MyService.ProcessRequest(HttpContext.Current);

  3. Then, create a class called MyService, with a bit of reflection to figure out which service method to call (based on your URL and query string parameters), and a call to XmlSerializer to convert the return value to XML. One example (in my case, called SearchService), can be found here.
That’s it. Three easy steps! Now you have a REST service. No changes to your WCF service contract. Your interface can stay intact – even with the WCF attributes still on it!

So to those who want to implement a simple REST service without the hassle of WCF, here you go. From now on, I prefer not to use WCF unless I absolutely have to.
July 23, 2010 6:37 PM Eastern Daylight Time  #    Comments [0] - Trackback
.NET | Commentary | Internet | News | Personal | Technology | Tips
# Friday, July 16, 2010




Project Vmana: Lucene.NET in the Cloud

An idea has been tossing & turning in my head for months now - 3 months actually. Rarely does an idea stick around that long without me finding some way to dismiss it.

The idea is a hosted customizable search engine, similar in ease of use to GSA (Google Search Appliance) but more capable - more like Lucene.

After searching for hours & hours for a decent hosted search engine, guess what? I found nothing.

The closest thing I was able to find was GAELucene (on Google Code). It's a Google App Engine version of Lucene. However, the index can only be read-only. It does not support a dynamic index. Without that, it's useless to me.

Hosted Applications - Some Examples

Just so you are less inclined to think I have finally lost my marbles:
  • IIS --> Windows Azure
  • SQL Server --> SQL Azure
  • Outlook --> Gmail
  • Backup --> Mozy
  • Bugzilla
  • SVN
There is a clear trend towards traditional server/desktop applications moving over to hosted services.

Getting a Customized Search Engine ... the Traditional Way:

These days, if you need a customized search solution, your options are as follows:
  1. Purchase, deploy, and maintain a gigantic enterprise search application (e.g. Google search appliance, Endeca, FAST).
  2. Integrate Lucene (or another free search engine) into your application (Java/ASP.NET) and develop your own management interface for it.
  3. Drop the customization and integrate a basic Google search box into your web app, that can only index & search your HTML pages.
Clearly, none of these options are particularly appealing to a small or medium-sized business. Why?

- Option 1 is super-expensive. Not only is the entry cost in excess of $20,000, the cost of maintenance and operation also exceeds $10,000 per month.
- Option 2 is less expensive, although certainly not free, and very time consuming. It could take at least 5 weeks to get a working solution, resulting in more than $5,000 in development costs. Then there's the cost of hosting Lucene yourself. With a large index, you probably need a dedicated server - around $200 per month!
- Option 3 is super cheap, but it's not at all what you want. It's basically the same as giving up.

Is there a better way?

Yes! There is one more option - option 4. But nobody's built it yet.

Option 4 is a hosted search engine where you control what data flows in & how it comes out, but the management & maintenance is handled by someone else.

Think of it as cloud search.

Two words! Simple.

Enter Project Vmana. Thinking search? Think Vmana.

How would it work?
  1. You go to vmana.com and sign up for your free entry-level search account.
  2. Just like App Engine, Vmana is metered. Let's say your entry-level account has 500 MB of index space and 100,000 queries per month.
  3. Using an easy-to-use admin interface, you configure your data sources:
    1. You want some data to be pulled in from your blog, so you give it your RSS feed URL.
    2. You want it to crawl your website, so you give it your home page URL.
    3. You set up some exclusion lists using regular expressions to filter out unwanted URLs.
    4. You have some custom objects with metadata that you will feed in with your own feeder application.
  4. Vmana handles all of your object types & indexes them regularly. You can check your stats using the built-in dashboard.
  5. Vmana provides a testing console - a simple web page where you can type in queries, see results, and build out customized result templates for use later.
  6. You then use the Vmana XML API to send queries from your web application. Your web app just builds the query, sends it to Vmana, and retrieves the results in XML format. Then, you apply a bit of XSL and magic happens - you've got your fully-customized search results page.
How much development effort is involved? Probably about 5 days. Under $1,000.

The value in Vmana lies mainly in the management & admin interface. Lucene does not provide it. If you did option 2, you'd have to build it yourself from scratch. Building all that crawling logic and pretty reporting UIs is not that easy, which is why I said 5 weeks, and that's probably a conservative estimate!

Why "Vmana"? I like the name - it's short, and the domain was available. ;)

Summary

With Vmana, your costs are reduced to about one-fifth relative to comparable options and you get better value & peace of mind!

The project has already begun. Stay tuned for additional status updates - probably in about 3 days.

Release Schedule

The first phase is a working internal prototype that we can showcase via screenshots. That is probably about 2 weeks away. Following that, a public beta - if one happens at all - would arrive around late August. The quality would be similar to the App Engine beta or the Azure CTP. The beta would continue probably for at least two months. Expect heavy promotional giveaways during the beta (i.e. high quotas).

This is all I will divulge at this time. I have nothing more anyway.

July 16, 2010 4:39 AM Eastern Daylight Time  #    Comments [2] - Trackback
.NET | Business | Commentary | Internet | News | Personal | Search | Technology
Archive
<September 2010>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789
About the author/Disclaimer

Disclaimer
The opinions expressed herein do not represent the opinions of the author or of any employer, employee, or associate of the author.

© Copyright 2010
Dan Tohatan
Sign In
Statistics
Total Posts: 182
This Year: 38
This Month: 0
This Week: 0
Comments: 46

Computers
Top Blogs


Copyright © 1999-2010 Dacris Software, Inc. All Rights Reserved.     Privacy Policy  |  Who We Are  |  Blog

Need professional resume writing services?