Giter Site home page Giter Site logo

nilern / eximia Goto Github PK

View Code? Open in Web Editor NEW
42.0 2.0 2.0 117 KB

A fast and small XML processor for Clojure. With XML namespace support and secure defaults.

License: Eclipse Public License 2.0

Clojure 99.84% Shell 0.16%
clojure xml xml-parser xml-writer

eximia's People

Contributors

nilern avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lgyyj lowecg

eximia's Issues

Is there a way to consume XML elements lazily?

I've been using Eximia and have been very pleased with its performance and simplicity.

However, I'd like to use Eximia to operate on large documents in a memory-constrained environment (AWS Lambda)

The parsing seems to eagerly process all of the XML input which consumes a lot of memory and places a hard limit on the size of input that can be processed. For example, if I load a 29MiB input document, my Lambda reports a memory usage of 780MiB.

Would it be possible to have an option to consume the stream of XML tokens lazily, say via a lazy seq?

Lazy default factory creation

Your comments suggest that factory creation is expensive:

Note that XMLInputFactory instances can be very expensive to create but are reusable. So call this as rarely as
possible, probably only in the application startup phase.

I'm using Woodstox with Eximia and it looks like the default input factory is created eagerly and is unnecessary in my case:

(def ^:private ^XMLInputFactory default-input-factory (input-factory {:coalescing true}))

I'm using Eximia in AWS Lambda, natively compiled with GraalVM**. The XML libraries can touch a lot of classes under the hood. This will cause GraalVM to pull those classes into the native build, so anything that can be done to avoid touching/instantiating unnecessary code will yield tangible improvements in deployment size and startup time (especially from cold starts).

** see https://github.com/FieryCod/holy-lambda

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.