Giter Club home page Giter Club logo

Comments (5)

jlfwong avatar jlfwong commented on May 25, 2024

Hey! As far as I remember, there's no circumstance where source-maps are automatically applied. That said, speedscope lets you apply sourcemaps after-the-fact.

See #317

from speedscope.

mbrevda avatar mbrevda commented on May 25, 2024

speedscope lets you apply sourcemaps after-the-fact.

Thats cool! Unfortunately, dropping sourcemaps doesn't seem to have any effect on paths or symbols. Is there another way to load them that I can try?

from speedscope.

mbrevda avatar mbrevda commented on May 25, 2024

Could this be related to esm code? I tried generating my code as .js (from .mjs) but that didn't help. Any way to debug sourcemaps to see if they are finding anything to apply?

from speedscope.

jlfwong avatar jlfwong commented on May 25, 2024

I'm not sure offhand if this would have anything to do with esm!

If you want to debug, your best bet would be to step through the code here:

let fileMatches = false

To get up and running locally, check out https://github.com/jlfwong/speedscope/blob/main/CONTRIBUTING.md

from speedscope.

mbrevda avatar mbrevda commented on May 25, 2024

Good call! It seems that the prof traces aren't having their filename/line/column populated. Not sure if this is the best way to do it, but the following patch fixes that:

diff --git a/src/lib/profile.ts b/src/lib/profile.ts
index 4e04742..13b189b 100644
--- a/src/lib/profile.ts
+++ b/src/lib/profile.ts
@@ -66,6 +66,15 @@ export class Frame extends HasWeights {

   private constructor(info: FrameInfo) {
     super()
+    if (!info.file && !info.line && !info.col) {
+      const matches = info.name.match(/(?:\/\/?)?([^:]+):(\d+):(\d+)/)
+      if (matches) {
+        info.file = matches[1]
+        info.line = parseInt(matches[2], 10)
+        info.col = parseInt(matches[3], 10)
+      }
+    }
+
     this.key = info.key
     this.name = info.name
     this.file = info.file

However, even with this patch, the frames aren't remapped to their proper sources.

from speedscope.

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.