views:

123

answers:

2

Hello all, I really don't have any substantial code to show here, actually, that's kinda why I am writing: I looked at the SproutCore demo, especially the Collection demo, on http://demo.sproutcore.com/sample_controls/, and am amazed by its loading 200,000 records to the page so easily. I tried using Rails to provide 200,000 records and in a completely blank HTML page with <% @projects.each do |p| %> <%= p.title %> <% end %> that freezes the browser for seconds on my m1530 laptop with 4gb ram and t7700 256gb ssd.

Yet the sproutcore demo does not freeze and takes less than 3 seconds to load.

What do you think the one technique they are using to enable this is?

Thanks!

A: 

More on sproutcore here.. http://ostatic.com/blog/sproutcore-raises-the-bar-for-client-side-programming

If on the other hand you are looking for concurrency then node.js is the way to go.

Shripad K
Thanks Shripad. Correct me if I get this wrong, I thought only Webkit or ,even more narrowly, Safari has client-side db storage using, best of my guess, Sqlite? That demo works on Firefox and IE8 as well!
Nik
A: 

I imagine the demo provided isn't being generated dynamically - it's static data.

Very few systems would be able to iterate a collection of live data that size. There are a number of techniques including streaming the dataset (using batch iteration through the records) through to caching and ajax partial loading strategies.

Toby Hede
But with 200,000 data, even if you do an ajax call for ever 1000, that's 200 calls, it probably wouldn't get done in 5 seconds. If you do 10,000 each, that might fit the ajax calls in 5 seconds, but I tried loading 10,000 just <span>Hello World</span> from a Rails app, that took a while to just show up on the screen and I don't think my computer is that slow. To think putting 20X more that quickly...
Nik
True, loading with ajax would take many smaller calls. The point I was making is that the data isn't being loaded in that demo ... it's a static file with the 200k entries, which should be pretty blazing on any system.
Toby Hede
Do you mean to say that it is one hugh abc.html file with those entries already in place?? You know, haha, I never thought about that
Nik