Ayende @ Rahien

Oren Eini aka Ayende Rahien CEO of Hibernating Rhinos LTD, which develops RavenDB, a NoSQL Open Source Document Database.

Get in touch with me:

oren@ravendb.net

+972 52-548-6969

Posts: 7,372 | Comments: 50,768

Privacy Policy Terms
filter by tags archive
time to read 4 min | 718 words

I got some really great comments on my last post. Apperantly FireFox doesn't report on the wire numbers, so here are the numbers from Fiddler.

After clearing the cache, a page with a text box, ScriptManager and CalendarExtender:

Request Count:  17
Bytes Sent:  10,492
Bytes Received: 149,145

Refreshing the page (meaning we get stuff from the cache):

Request Count:  14
Bytes Sent:  9,382
Bytes Received: 31,932

That is still 31Kb that I am not sure where they are coming from. Based on the feedback from the last post, it looks like there are a few other things that need to be done.

  • Get AjaxToolKit that is compiled in release mode.
  • <compilation debug="false">
  • <

    scriptResourceHandler enableCompression="true" enableCaching="true" />

After clearing the cache, same page:

Request Count:  14
Bytes Sent:  9,282
Bytes Received: 122,254

Refresh the page (get stuff from cache):

Request Count:  14
Bytes Sent:  9,382
Bytes Received: 32,010

So, we still get 31Kb, but worse than that, we get 14 requests(!).

Same page, without CalendarExtender (no cache):

Request Count:  5
Bytes Sent:  2,806
Bytes Received: 56,702

With cache:

Request Count:  4
Bytes Sent:  2,482
Bytes Received: 23,873

The request that seems to be biggest (and apperntly uncached) is: /WebResource.axd?d=vreWgJm8KHsCnZnd2dT3Zg2&t=633067941986250000 and it contains javascript functions such as WebForm_PostBackOptions and friends.

For comparision purposes, I have removed the ScriptManager as well:

Request Count:  2
Bytes Sent:  978
Bytes Received: 2,540

And when it is cached:

Request Count:  1
Bytes Sent:  554
Bytes Received: 747

As far as I can tell, I am doing everything the way I should do it. But this also means that the issue is with the weight, but the request count. HTTP allows only 2 requests per host, and that means that in cases where just the scripts takes 14 requests, everything else that is Ajaxified will need to wait for them to complete.

The solution for me was to drop the CalendarExtender completely, I went with a simple javascript calendar, it doesn't do sliding animations and other cool stuff that the CalendarExtender does, but it doesn't kill my site when it is working, either.

time to read 7 min | 1362 words

I have the strong feeling that I am missing something. We have just run into a major slow down in one of our pages, as a result of adding the CalendarExtender. This led me to do some searching, and I am not sure that I can believe the results.

Let us take this simple page:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="ExplodingMonkeys.Web.test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

    <title>Untitled Page</title>

</head>

<body>

    <form id="form1" runat="server">

        <asp:TextBox ID="Date" runat="server" />

    </form>

</body>

</html>

When rendered to the browser, it weight 528 bytes. Now, let us add a <asp:ScriptManager runat="server"/> to the page. The size of the page exploded to 79 kilobytes, from this change alone.

I then added the following to the page:

<ajax:CalendarExtender runat="server" TargetControlID="Date" CssClass="ClassName" Format="MMMM d, yyyy"
PopupButtonID="http://ajax.asp.net/ajaxtoolkit/Calendar/Calendar_scheduleHS.png" />

The page size reached 143 kilobytes. I am pretty sure that I am missing something here. I enabled both caching and compression in the web config:

<

scriptResourceHandler enableCompression="true" enableCaching="true" />

And then tried again. The results were better, but not really encouraging.

With just script manager: 79 KB (56 KB from cache)
With calendar extender: 143 KB (115 KB from cache)

Just to make it clear, there is a noticable delay on our pages, it went from being instantenous to taking four or five seconds. And I am talking about localhost testing, on powerful machines. (Again that HTTP 2 connections per server issue, I think).

Am I missing something, or are those the real numbers?

FUTURE POSTS

No future posts left, oh my!

RECENT SERIES

  1. Production postmortem (44):
    15 Sep 2022 - The missed indexing reference
  2. Webinar recording (15):
    26 Aug 2022 - Modeling Relationships and Hierarchies in a Document Database
  3. re (32):
    16 Aug 2022 - How Discord supercharges network disks for extreme low latency
  4. Recording (5):
    25 Jul 2022 - Build your own database at Cloud Lunch & Learn
  5. High performance .NET (7):
    19 Jul 2022 - Building a Redis Clone–Analysis II
View all series

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats