Switching from MSN space to Blogger.com After trying new set of blogging and picture sharing tools, including blogger.com, blogger for word, hello+picasa, flickr. I decided to quit the domain of Microsoft blogging field, follow google for the following reasons:
blogger has more flexible template definition tools, it gives you ability to manage you site appearance in html code level
blogger from word really improve my productivity of blogging, in contract to the old msn space’s online editing or email publishing. Now you can take advantage of word’s powerful editing capability
hello+picasa indeed brings picture uploading and sharing process into a new era, instead of spaces’s loose resolution picture sharing.
xml communication indicates the Web 2.0’s coming, you can use a bunch of tools not matter you are online, or in word, or hello, or any other xml-aware tools
personal belief that google’s fasting growing and effect of rapid evolution process including new technology implementation and fresh tools
DataSet as webservice passing object tuning Linus 2005-11-20
Background SmartClient technology now is very common used in the new era of SOA infrastructure, as publishing a webservice to the whole world, getting rid of bothering issue like firewall, has become a piece of cake. In .net, Microsoft gives birth of dataset, originated from recordset, which struts its stuff in the world of data binding. DataSet, usually represents a portion of relation table data, could contain a considerable amount of data returned from database. When passing this kind of large object by web service, due to the inborn issue of http communication regarding to TCP/IP (the performance issue), it would bring a headache for your app’s performance, especially critical in a slow network environment. Practices
.net dataset serialization
I was planning to using binary serialization instead of xml serialation after I found out that most of SOAP package data are xml tags. But things are not that easy. In .net framework 1.1, drilling down the implementation code, you could discover that, the framework would use XmlSerialization, even if you choose BinaryFormatter, to serialize the dataset. Let’s check it out as the following. voidISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { string text1 = this.GetXmlSchemaForRemoting(null); string text2 = null; info.AddValue("XmlSchema", text1); StringBuilder builder1 = new StringBuilder(this.EstimatedXmlStringSize() * 2); StringWriter writer1 = new StringWriter(builder1); XmlTextWriter writer2 = new XmlTextWriter(writer1); this.WriteXml(writer2, XmlWriteMode.DiffGram); text2 = writer1.ToString(); info.AddValue("XmlDiffGram", text2); } You can see that it would append xml schema, following by the dataset xml data. When the dataset is a pretty complex one, I found out that the schema would result in 15K bytes transportation. Microsoft has already noticed this problem. In .net framework 2.0, binary serialization is pretty small than the old version, because it does NOT use xml serialization as binary serialization again. private void SerializeDataSet(SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat) { info.AddValue("DataSet.RemotingVersion", new Version(2, 0, 1)); info.AddValue("DataSet.RemotingFormat", remotingFormat); info.AddValue("SchemaSerializationMode.DataSet", this.SchemaSerializationMode); if (remotingFormat != SerializationFormat.Xml) { … for (int num1 = 0; num1 < this.Tables.Count; num1++) { this.Tables[num1].SerializeTableData(info, context, num1); } … } … } Of course, I should try another way, because we are using .net framework 1.1. That results in the following tricky means.
Compressed webservice communication
In accident, I figured out, when I zipped my response data, it’s size would become about 7 times less than the original. So I start to put this method, what I called compressed webservice communication, into practice.
Change the WebService WebMethod a little bit, returning a string instead of DataSet
The result was astonishing, using Ethereal you would discover the data package dropped from 182K to 11K. And our result performance upgrades from 14seconds to 3 seconds average. Awesome! (image placeholder) Tools