GithubHelp home page GithubHelp logo

Comments (5)

darkfrog26 avatar darkfrog26 commented on June 4, 2024

I know this may seem strange, but make sure you've cleaned your compiled classes to avoid legacy Macro compiled code. If that doesn't resolve it, please share a minimal application with me that reproduces the error and I'll dig in from there. Also, is it possible you have pre-compiled code referring to an older version of Scribe?

from scribe.

crimzie avatar crimzie commented on June 4, 2024

Not strange at all. The first thing I did is made sure to clear out all compiled artifacts.

The project is closed source code, but I'll see if I can get it reproduced in a minimal application without breaching nondisclosure.

from scribe.

crimzie avatar crimzie commented on June 4, 2024

I went the other way around and removed scribe method calls one by one until it compiled. Here are the culprits:

scribe.info(f"Constructing (max: ${Runtime.getRuntime.maxMemory / 1e6}%.0f, $memoryString)")
(def memoryString: String = f"total: ${Runtime.getRuntime.totalMemory/1e6}%.0f, free: ${Runtime.getRuntime.freeMemory/1e6}%.0f")

_ = scribe.info(s"Public page ${page.copy(content = Array.empty[Byte])} was found for processing.")
inside a monix.eval.Task for-comprehension

pubRes.foreach(_ => scribe.info(f"New public and private reprs for mark ${m.id} with similarity ${pubRes.get.repr.vecSimilarity(res0.repr)}%.3f"))
pubRes being an instance of Option

from scribe.

darkfrog26 avatar darkfrog26 commented on June 4, 2024

Just for kicks, try replacing those interpolators with Scribe's sfi interpolator.

For example, for the first item it would be:

scribe.info(sfi"Constructing (max: ${(Runtime.getRuntime.maxMemory / 1e6).f(f = 1)}, $memoryString)"

If you look at the https://github.com/outr/scribe/blob/master/core/shared/src/main/scala/scribe/implicits/LongImplicits.scala and https://github.com/outr/scribe/blob/master/core/shared/src/main/scala/scribe/implicits/DoubleImplicits.scala they offer a more type-safe numeric formatting alternative. In addition, sfi is usually about ten times faster than f or s as it uses a Macro to create far more efficient string building.

from scribe.

crimzie avatar crimzie commented on June 4, 2024

Thanks. Had no idea scribe has its own interpolator.

from scribe.

Related Issues (20)

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.