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

seems to be a problem with cpu usage #5

Open
Mistifiou opened this issue Aug 17, 2017 · 2 comments
Open

seems to be a problem with cpu usage #5

Mistifiou opened this issue Aug 17, 2017 · 2 comments
Assignees

Comments

@Mistifiou
Copy link

Mistifiou commented Aug 17, 2017

just creating base project with consolestats, screeps-profiler, and several task as uglify (but not on this project, because ecma 6 incompatible with last version of uglify according to this issue ).

[] as options

log tick 6430
CPU usage is far more 100%

image

@quonic quonic self-assigned this Aug 17, 2017
@quonic quonic added the bug label Aug 17, 2017
@quonic
Copy link
Contributor

quonic commented Aug 17, 2017

Once I get off work I'll take a look at it. It is interesting that this would happen in the sim. I'll have to do some testing and see if the sim reflects production or not. I suspect it wont as the sim is dependent on your computer.

@quonic quonic removed the bug label Aug 18, 2017
@quonic
Copy link
Contributor

quonic commented Aug 18, 2017

I don't see a problem with cpu usage in production. I average around 3 cpu units per call for everything.

I think it might be due to a bug in the sim code. It well known by veteran players that the sim isn't 100% 1:1 with production.

I would recommend trying it out in a private server if you can.

    if ((Game.time % 1) === 0) {
        let totalTime = Game.cpu.getUsed()
        console.log(statsConsole.displayHistogram());
        console.log(statsConsole.displayStats({ totalWidth: 100 }));
        console.log(statsConsole.displayLogs(Memory.stats.logs, { width: 100 }));
        totalTime = (Game.cpu.getUsed() - totalTime);
        console.log("Time to Draw: " + totalTime.toFixed(2));
    }

Example

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

2 participants