New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Size Goals #26
Comments
Not an urgent question at all, but how does JMVC compare size-wise to other MVC-like JS frameworks? I remember Brian LeRoux making a comparison chart against frameworks for TodoMVC but this wasn't really reflective of the framework components alone :) |
IMO, this is not a good question. It's the one simple, tangible value that people can easily compare so its importance gets far overblown. Size is important, but only when standing along-side an understanding of features. With that being said, I think BB is 5 KB with it's underscore dependency. I'm not sure about other frameworks. But also with that being said .. BB has nothing like I think a size comparison should ONLY be coupled alongside an explanation of features, etc. JMVC is smaller than Dojo, but it doesn't have widgets and a whole host of other things. |
Oh, and the fact that you can just use |
In a branch, I am able to get:
I did this by removing unessential features. For example, this._super, this.proxy, This would make the total about: 5.5k. This would be the same size as backbone+underscore, but include things like automatic unbinding, new Tabs($('#foo'),{}) |
Another iteration: Model 3.04KB (Δ +0.22 KB) 2.88KB (+0.04)Break Down:
Plus
Minus
Class 0.66KB ( Δ -0.32 KB )Minus
Controller 1.33KB ( Δ -0.4 KB )minus:
ThoughtsI cut about .7KB. But, I haven't spent time on $.Observe |
So BB (4.6KB) and it's Underscore dependency (3.74KB) are 8.33KB. Currently, the MVC parts are 6.92. This does not include route ( 1.16KB ) and hashchange ( .5kb ). So, MVC + R+H = 8.58. |
I have the small mvc parts down to 5.79KB. Awesome. |
So now, with hashchange, deparam, $.route, and controller/route, JMVC comes to: 7.33 KB! controller/route lets you bind to specific routes like: $.Controller('Routes',{
"foo/:bar route" : function(data){
data.bar
},
"route" : function(){
// fires when hash is empty
}
}) We could use an html5 converter ... |
Great job, Justin! :) |
Wow, that's tiny! |
It's now 9.16KB with EJS (and EJS's new live-templating). Without EJS, it's about 7.4k (excluding hashchange). It will be about 1k bigger for Zepto because it brings deferred support. |
Here's the breakdown ... You can see that EJS is now a fat ass ...
|
combined, EJS + View is 3.5k ... much too big. |
Total is now 8.8k.
You an see that EJS+View has blown (3.3k) up b/c of live templating. However, this is largely equivalent to Knockout now. |
@justinbmeyer really great work on this. Are there plans on making the improvements more visibly documented somewhere? |
This has been accomplished via CanJS |
I'd like to keep JMVC as small as possible. Here are some size-ish goals:
$.Class
currently: .985 KB
wanted: < .900 KB
$.Controller
currently: 1.74 KB
wanted : < 1.7 KB
$.Model
currently: 2.82 KB > 2.74KB
wanted: 2.5 KB
$.View
currenty: 1.62 KB
wanted: 1.5 KB
$.EJS
current: 1.5 KB
I think this is ok :-)
$.String
current: .666 KB > .650 KB
wanted: .5 KB
Summary
Combined, this would bring JMVC to 8.6 KB (which is back to inline with my 7kb goal for everything w/o EJS).
Oh, also steal ...
Steal
current: 4.97 KB
wanted: 4 KB
join and such needs to be cleaned up for this
The text was updated successfully, but these errors were encountered: