Saturday, 15 September 2012

javascript - Page load times using a Scanner (IE5) -



javascript - Page load times using a Scanner (IE5) -

i have mvc project have build spa using knockoutjs , sammy. set script in page head.

<script> var starttime = (new date()).gettime(); </script>

and @ end of body, set this:

@scripts.render("~/scripts/required") @scripts.render("~/scripts/app/views") <script> $(function () { $(window).load(function () { var endtime = (new date()).gettime(); var millisecondsloading = endtime - starttime; // set millisecondsloading in hidden form field // or ajax server or whatever. alert(millisecondsloading); }); }); </script>

the scripts beingness loaded these:

' more info on bundling, visit http://go.microsoft.com/fwlink/?linkid=301862 public sub registerbundles(byval bundles bundlecollection) bundles.add(new stylebundle("~/content/css").include( "~/content/core.css")) bundles.add(new scriptbundle("~/scripts/required").include( "~/scripts/jquery-1.9.0.min.js", "~/scripts/json2.js", "~/scripts/jquery.cookie.js", "~/scripts/knockout-3.2.0.js", "~/scripts/knockout.validation.js", "~/scripts/sammy-0.7.5.js")) bundles.add(new scriptbundle("~/scripts/app/views").include( "~/scripts/app/_common.js", "~/scripts/app/_app.datamodel.js", "~/scripts/app/_app.viewmodel.js", "~/scripts/app/common.viewmodels.js", "~/scripts/app/error.viewmodel.js", "~/scripts/app/login.viewmodel.js", "~/scripts/app/home.viewmodel.js", "~/scripts/app/cut-lengths.viewmodel.js", "~/scripts/app/move-stock.viewmodel.js", "~/scripts/app/transfers.viewmodel.js", "~/scripts/app/allocations.viewmodel.js", "~/scripts/app/lot-enquiry.viewmodel.js", "~/scripts/app/_run.js")) ' set enableoptimizations false debugging. more information, ' visit http://go.microsoft.com/fwlink/?linkid=301862 bundletable.enableoptimizations = true end sub

now, if run using ie5 on development machine alert between 200 , 300 ms. good. but, when run on scanner, takes on 20000 ms (20 seconds) load.

here times each script add together them, in order (starting jquery)

5 seconds (jquery on it's own) 6 seconds (jquery, json2) 6 seconds (jquery, json2, jquery-cookie) 8 seconds (jquery, json2, jquery-cookie, knockoutjs) 9 seconds (jquery, json2, jquery-cookie, knockoutjs, sammy)

now, start adding view models see impact these have:

9 seconds (app datamodel) 10 seconds (app datamodel, viewmodel) 11 seconds (app datamodel, viewmodel , common)

each other view model takes around sec load.

has ever experienced before? if so, how did prepare it? @ loss because have application loads around same amount of scripts , pretty much instant.

please help!

internet explorer 5 not supported, wouldn't expect work well:

knokcoutjs

supports mainstream browsers, ancient ones ie 6+, firefox 3.5+, chrome, opera, safari (desktop/mobile)

jquery

jquery 1.x internet explorer 6+

sammy

in general sammy aims back upwards modern , current browsers across plugins , core. includes: ie >= 8

javascript jquery asp.net-mvc knockout.js

No comments:

Post a Comment