clojure.xml/parse adds large overhead by creating ParserFactory on each invocation

Description

A single invocation of clojure.xml/parse spends ~80μs instantiating a new SAXParserFactory. This overhead brings a lot of waste when using clojure.xml/parse on many small inputs. Here's a brief test case:

The profiler tells me that most of the time is spent in constructing the factory:

After the proposed fix, the time of the snippet reduces to 340ms.

Environment

None

Assignee

Unassigned

Reporter

Alexander Yakushev

Labels

None

Approval

None

Patch

Code

Affects versions

Priority

Minor
Configure