back referential expressions can cause exponential compilation times

Description

Reported as causing problems in real world code: https://groups.google.com/forum/#!topic/clojure/Z91bhUvSB1g

With init.clj as :

Before patch:

After patch:

This is caused by every local bindings' type depending on the type of the previous binding, triggering an exponential number of calls to hasJavaClass and getJavaClass. By caching on first occurrence, the complexity becomes linear.

Patch: 0001-CLJ-2210-cache-non-trivial-getJavaClass-hasJavaClass.patch

Prescreened by: Alex Miller

Environment

None

Attachments

1

Activity

Show:
Completed

Details

Assignee

Reporter

Approval

Ok

Patch

Code

Priority

Affects versions

Fix versions

Created July 21, 2017 at 11:28 AM
Updated September 6, 2017 at 5:42 PM
Resolved September 6, 2017 at 5:42 PM