Monday, October 17, 2011

Speed Test: Document-Relative vs. Root-Relative

Today I got curious if there was a speed difference for loading using Document-Relative paths or Root-Relative paths.

I created a sample test on one of my sites which loads up 583 thumbnails and put in a trigger to change the type of relative pathing utilized.

I did a series of load time measurements and based on these tests it appears that the difference insignificant. Therefore, use whichever method you like best.

Document-Relative Paths: http://aiwl.us/test/?relativity=document

Load Time First Byte Start Render DOM Elements Result (error code)
20.844s 0.516s 0.890s 586 0
Document Complete
Time Requests Bytes In
20.844s 583 3,050 KB
Fully Loaded
Time Requests Bytes In
20.844s 583 3,050 KB


Root-Relative Paths: http://aiwl.us/test/?relativity=root

Load Time First Byte Start Render DOM Elements Result (error code)
20.606s 0.430s 0.832s 586 0
Document Complete
Time Requests Bytes In
20.606s 583 3,070 KB
Fully Loaded
Time Requests Bytes In
20.606s 583 3,070 KB

Stumble Upon ToolbarDigg this Post This to FacebookShare on Facebook Tweet Me

2 comments:

  1. The requests made to the server should all be the same regardless. The only difference is the slight size difference in the HTML page and an extra few CPU cycles for the browser to convert the URL as needed.

    ReplyDelete
  2. Agreed, I wanted to verify that the browser handled both processes in the "same" amount of time. The question came up as a thought of unidirectional traversing vs omnidirectional traversing. Providing a single direction pathing from the starting point in thought would be faster than going both directions, but based on processing power would this difference be noticeable? Based on a quick test the answer was no.

    ReplyDelete