<< Back to previous view

[CLJS-696] remove arguments usage from defrecord constructor Created: 23/Nov/13  Updated: 16/Dec/14  Resolved: 16/Dec/14

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File cljs_696_v1.patch    
Patch: Code

 Description   

There is no need for the arguments usage in the defrecord constructor and it's a perf hit for construction. We should always construct defrecords by passing in the extra three arguments: __extmap, __meta, and hash automatically.



 Comments   
Comment by Peter Schuck [ 16/Dec/14 11:59 AM ]

The constructor now has __extmap, __meta, and __hash in all the places it's constructor is called, the positional factory, map factory, and direct constructor invocation. This is the first time going deep into the ClojureScript compiler so there may be some clean up to do or other places a records constructor is called that I didn't take care of.

Comment by David Nolen [ 16/Dec/14 12:20 PM ]

Excellent work! Thanks! https://github.com/clojure/clojurescript/commit/491dd1bb6ba446407298d6fb93dd6cbd578d3b76

Generated at Mon Dec 22 11:08:18 CST 2014 using JIRA 4.4#649-r158309.