<< Back to previous view

[CLJS-503] v8 penalizes coercive nil? Created: 04/May/13  Updated: 04/May/13

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

Type: Enhancement Priority: Minor
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

We check for nil coercively with != and = because we want to handle both JavaScript null and undefined. These operations are slower than !== and ==. We would like to fix this but we can't simply make nil? not be coercive. The persistent data structures rely on this because they reach into JS Arrays that been allocated with a certain size. However in JS the empty slots are filled with undefined and null requiring the more expensive coercive nil? check.

Making nil? non-coercive seems to bring less of performance boost in WebKit/Firefox Nightlies, but v8 is still the king and everyone seems to be moving towards it performance wise.

One issue with making nil? non-coercive is that undefined will then fall through many of the core library functions. This means that users will need to be more careful in interop scenarios.


Generated at Sun Oct 26 03:11:59 CDT 2014 using JIRA 4.4#649-r158309.