Skip to content

Commit

Permalink
Merge branch 'develop' for v1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewdowney committed Apr 1, 2020
2 parents eaf6a6d + 5803f08 commit 329de54
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

## [1.2.1] - 2020-04-01
### Added
- Can bind a dynamic `*n-threads*` var to set the number of threads used during
writing.

## [1.2.0] - 2020-08-13
### Added
- Performance improvements for large worksheets.

## [1.1.2] - 2019-06-04
### Fixed
- If the first level of the tree is a leaf, `accounting-table` doesn't walk it
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ common sense styling.

Lein:
```
[org.clojars.mjdowney/excel-clj "1.2.0"]
[org.clojars.mjdowney/excel-clj "1.2.1"]
```

- [Getting Started](#getting-started)
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject org.clojars.mjdowney/excel-clj "1.2.0"
(defproject org.clojars.mjdowney/excel-clj "1.2.1"
:description "Generate Excel documents & PDFs from Clojure data."
:url "https://github.com/matthewdowney/excel-clj"
:license {:name "Eclipse Public License"
Expand Down
6 changes: 5 additions & 1 deletion src/excel_clj/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,14 @@
the column width."
15000)

(def ^:dynamic *n-threads*
"Allow a custom number of threads used during writing."
(+ 2 (.. Runtime getRuntime availableProcessors)))

(defmacro ^:private doparallel [[sym coll] & body]
"Performance hack for writing the POI cells.
Like (dotimes [x xs] ...) but parallel."
`(let [n# (+ 2 (.. Runtime getRuntime availableProcessors))
`(let [n# *n-threads*
equal-chunks# (loop [num# n#, parts# [], coll# ~coll, c# (count ~coll)]
(if (<= num# 0)
parts#
Expand Down

0 comments on commit 329de54

Please sign in to comment.