clj-commons / clj-commons/byte-streams

Lazy converter instantiation performance gotcha

Open
#62 1 comment 0 reactions 0 assignees View on GitHub
performance
Dominant language
Clojure
Stars
430
Forks
31
PR merge metrics
No merged PRs in 30d

Description

Converters are instantiated (and then memoized) lazily on first use. Since this is a rather heavy operation, it can influence timing-sensitive code as [recently observed in Aleph's test suite](https://github.com/clj-commons/aleph/issues/626). This is bit of a gotcha which [was even brought up in a past issue already](https://github.com/clj-commons/byte-streams/issues/10). That resulted in [the introduction of a `precache-conversions` API](https://github.com/clj-commons/byte-streams/commit/bea74d6927b9763d5ec0a026ad602bed9f8e28a4). However, it [later got removed again](https://github.com/clj-commons/byte-streams/commit/863e311b55d336488bf0345c1994e74f4e3416f8) without further explanation. In any case, the fact that this issue came up again indicates that such an API would still be desirable.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.