Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--profile produces too large files and numbers #5552

Open
greenfork opened this issue Apr 13, 2024 · 5 comments
Open

--profile produces too large files and numbers #5552

greenfork opened this issue Apr 13, 2024 · 5 comments

Comments

@greenfork
Copy link

The Problem

When I try to profile MUGS, it produces nonsensical to me data.

Expected Behavior

Produces good profile data.

Actual Behavior

It produces large files 50-80 MiB in size, they are too slow to load and have too large numbers in them.

screenshot

Steps to Reproduce

zef install MUGS
raku --profile $(which mugs-cli) adventure
^D

Environment

  • Operating system: Arch Linux
  • Compiler version (rakudo -v or raku -v):
Welcome to Rakudo™ v2024.02.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2024.02.
@demanuel
Copy link

I can reproduce this with the latest rakudo version. My firefox takes ages to load the report, and the report is mostly unusable.

@niner
Copy link
Collaborator

niner commented Apr 15, 2024

The HTML profiler output is really only suitable for quite small programs as the profile data necessarily gets quite large. For a much better performing profiler look at https://github.com/timo/moarperf

@MasterDuke17
Copy link
Contributor

MasterDuke17 commented Apr 15, 2024 via email

@timo
Copy link
Member

timo commented Apr 15, 2024

There's also a known issue with the profiler that using "exit()" inside your code can cause the profile output to be pretty messed up. I haven't looked at MUGS, but it's possible that has something to do with it. I'm not sure how we can even get these really long numbers you're seeing in the screenshot, though

@MasterDuke17
Copy link
Contributor

There's also a known issue with the profiler that using "exit()" inside your code can cause the profile output to be pretty messed up.

This patch from @niner might be able to help with a workaround in this case:

diff --git a/src/vm/moar/HLL/Backend.nqp b/src/vm/moar/HLL/Backend.nqp
index 098e8a30c..479297251 100644
--- a/src/vm/moar/HLL/Backend.nqp
+++ b/src/vm/moar/HLL/Backend.nqp
@@ -51,9 +51,9 @@ class HLL::Backend::MoarVM {
     method run_profiled($what, $kind, $filename?) {
         $kind := 'instrumented' unless $kind;
 
-        my @END := nqp::gethllsym('perl6', '@END_PHASERS');
-        @END.push(-> { self.dump_profile_data($prof_end_sub(), $kind, $filename) })
-            if nqp::defined(@END);
+        #my @END := nqp::gethllsym('perl6', '@END_PHASERS');
+        #@END.push(-> { note("dumping in END"); self.dump_profile_data($prof_end_sub(), $kind, $filename) })
+        #    if nqp::defined(@END);
 
         self.ensure_prof_routines();
 
@@ -67,10 +67,10 @@ class HLL::Backend::MoarVM {
         }
 
         my $res  := $what();
-        unless nqp::defined(@END) {
+        #unless nqp::defined(@END) {
             my $data := $prof_end_sub();
             self.dump_profile_data($data, $kind, $filename);
-        }
+        #}
         $res;
     }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants