sci

zeitstein 2025-03-22T08:44:44.770969Z

A question regarding best practices with an eye towards performance. I'm using SCI from clj and cljs (potentially during render). Not doing anything crazy at the moment – just eval'ing user-provided pure functions. 1. How costly is passing Clojure vars into SCI? Does it scale with size of the data? 2. When wanting to expose entire namespaces to SCI, I'm guessing doing this ahead-of-time (rather than on every eval call) is possible through create-ns? Any other tips welcome. Thanks!

borkdude 2025-03-22T09:12:23.950589Z

@mithrandir03 The amount of vars has nothing to do with performance I think. You can copy an entire namespace using sci/copy-ns . Documented here: https://github.com/babashka/sci?tab=readme-ov-file#copy-a-namespace

zeitstein 2025-03-22T10:01:52.983319Z

Thanks! I didn't mean the amount of vars, but the size of data they hold. E.g. passing in a map with thousands of entries.

borkdude 2025-03-22T10:02:27.106169Z

why should that matter?

zeitstein 2025-03-22T10:02:46.484209Z

I don't know. Don't really know how SCI works 🙂