Tuesday, August 12th, 2008

Squirreling out the Fish on the iPhone

Category: iPhone, JavaScript, Mobile, Performance

  1. <script type="text/javascript">
  2. function recurse(n) {
  3.     if (n > 0) {
  4.         return recurse(n - 1);
  5.     }
  6.     return 0;
  7. }
  8.  
  9. try {
  10.     // recurse(43687);  // Highest that works for me in WebKit
  11.                         // nightly builds as of 24 Jul 2008.
  12.     // recurse(2999);   // Highest that works for me in Firefox 3.0.1
  13.     // recurse(499);    // Highest that works for me in Safari 3.1.2
  14.     recurse(3000);
  15.     document.write("Could be SquirrelFish.");
  16. } catch(e) {
  17.     document.write("Not SquirrelFish.");
  18. }
  19. </script>

This is the hack that John Grubber used to test whether iPhone 2.x had snuck in SquirrelFish. He was curious due to the performance improvements that he witnessed:

What about iPhone limits though? David Golightly tests the limits on the iPhone with a script that keeps downloading tiles until it can no longer do so:

After downloading about 210 images, the iPhone simply stops downloading new ones. This is probably due to hitting the hard 30MB same-page resource limit.

Posted by Dion Almaer at 6:11 am
1 Comment

++++-
4.1 rating from 24 votes

1 Comment »

Comments feed TrackBack URI

So basically, when SquirrelFish hits, it will hardly show up on the graph. :D

Comment by eyelidlessness — August 12, 2008

Leave a comment

You must be logged in to post a comment.