Display ModuleScripts under Script Performance/Script Activity

As a Roblox developer, it is currently too hard to measure the performance of module scripts in my games and locate performance issues from them.

If Roblox is able to address this issue, it would improve my development experience because it would allow me to much more easily identify performance issues without needing to struggle with the server sided microprofiler.

Originally I assumed this was a bug however a staff member confirmed here that it is not:

Other users in that post shared similar interests in seeing module activity inside of the Script Activity/Script Performance section. Currently module activity doesn’t show up at all and goes completely uncounted. It does not show up under the parent script’s total at all.

Being able to quickly identify scripts which are using lots of CPU would greatly improve my ability to narrow down the locations of certain performance related issues and better identify which scripts I can improve upon.

For example, my game uses a single starter script. This starter script starts several worker modules which end up requesting various service modules. These service modules end up registering most connections in the game and if activity was tracked for modules all of these connections that I start in the body of different modules would count towards activity somehow but all of the activity in my game shows up as zero besides the default Roblox scripts.

Here is a common example of how events are commonly registered in this way:

local entities = workspace:WaitForChild("Entitites")

local function addEntity(child)
    -- Do some stuff
end
for _, child in ipairs(entities:GetChildren()) do
    addEntity(child)
end
entities.ChildAdded:Connect(addEntity) -- This event connection goes completely untracked since the calling environment is a module and modules are not tracked in Script Activity/Script Performance

local SomethingService = {}
-- Service stuff
return SomethingService

If I were to accidentally use DescendantAdded but only my top level instances still pass the check the script activity would be much higher assuming I’m adding or removing a lot of instances in the Entities folder at once and it would be easy to identify the concern during regular testing and it would be easy to identify that it must be the event connection there since its the only thing connected in the body of the module.

There are a lot of cases where I have connected a more expensive event without knowing it and later ended up having to go through lots and lots of debugging to locate the issue. To make things worse, the microprofiler doesn’t help here because this usually isn’t something I would profile, and, if I did it would not clearly reveal the problem unless you pay attention to all of the blocks in the microprofiler and make the connection that there are too many there.

The server microprofiler can be a bit annoying to work with since you need to download the results, go into your logs folder, and view the HTML file in a browser. That’s not something I want to do in Studio especially, and, while in Studio I believe I can use the microprofiler if I switch to the server view, it’s still not as concise as seeing the script activity fluctuate so much is usually a really good tell that something is up if its a simple event.

45 Likes

I have a single initializer script which works with many modules. It’s hard to diagnose where performance issues come from without being able to find out which module has the performance glut.

2 Likes

My framework also uses a single initializer script. It would help a ton if Roblox added ModuleScripts to Script Activity!

1 Like

Yeah, I have to copy the entire contents of each ModuleScript and plop them somewhere into the initializing LocalScript. It’s a pain

1 Like

+Support

Most of my game is made up of module scripts for organization, and its frustrating not being able to see the performance

image

Bumping this up to bring attention since no staff member gave his opinion on ModuleScripts being filtered out of the Script Activity menu.

As @baseparts said, my game is also composed of modules. A lot of time you will be connected to an event or even have active coroutines that were created when require was called.

Someone can think their game is running very well and that their scripts are really low in activity when the ModuleScripts could be reaching 6% + without them even noticing.

The response that a staff member gave to the bug report made is totally insane. Noting that a ModuleScript's activity is totally untracked as @Hexcede said, and is not even attributed to the script that required the ModuleScript. Reply from a staff member in 2021:


In short, I rely so much on modules and they do a lot of tasks that I want to track. Sometimes I have to avoid having these tasks in modules just because of this issue.

One year and seven months have passed. I understand you guys have priorities but this just discourages me from creating future requests, like the water one I did.

Thank you, focasds.

6 Likes

Certainly a needed feature. There aren’t any debugging features that cover this without excessive amounts of overhead by developers in everything they write.

Hoping to get an update on this. Single script architectures are really popular within Roblox nowadays, there are tons of games alone that use Knit and their own custom frameworks, I don’t see why this wouldn’t be considered nor added.

I think the issue here is that you can’t just figure out if a ModuleScript is using performance.

Like many people here say - they use a single script to initialize their modules. But this means that you only have a single script running. Those modules are simply returning functions being run by that script.

This feature would help out a LOT

Bumping as this feature is of high importance for identifying and measuring performance.

1 Like

Bumping would love this feature!

1 Like

another bump, crazy this doesn’t exist yet

You can use the Script Profiler within the dev console, which didn’t exist when I originally made this request. It’s a much faster way of benchmarking performance problems and is a lot more powerful than the Script Performance/Script Activity feature for this purpose.

c.c. @BuDeep @Lucke0051

2 Likes

your the goat man, this has helped me out a lot

1 Like