HTML and CSS Reference
In-Depth Information
Figure 4.1 Profiling Twitter's search feature.
complex code. As an example of the Firebug profiler, Figure 4.1 shows the profile
report after having used Twitter's search feature, which uses an XMLHttpRequest
to fetch data, and manipulates the DOM to display the results. The profile report
shows a lot going on inside jQuery, and a total of over 31,000 function calls.
4.3 Summary
In this chapter we have seen how unit tests can be utilized not necessarily only to
support production code, but also to help us learn more about JavaScript. Keeping
a suite of learning tests is a great way to document our learning, and they provide
a handy reference over issues we have encountered in the past. While reading this
book I encourage you to try out some of the examples and play with them to
understand what is going on. If you don't already have a learning test suite, now
would be a great time to start one, and you can start writing tests to further your
understanding of examples from this topic.
Benchmarks can help guide decisions when there are several viable ways of
solving a given problem. By measuring relative performance we can learn patterns
Search WWH ::

Custom Search