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

debug methods waste time and memory #104

Closed
cberzan opened this issue May 19, 2014 · 1 comment
Closed

debug methods waste time and memory #104

cberzan opened this issue May 19, 2014 · 1 comment

Comments

@cberzan
Copy link
Contributor

cberzan commented May 19, 2014

Possible starter task for @chrisgioia64.

Profiler shows that the Util.debug() calls in AbstractPartialWorld.setValue() waste a lot of memory. Example:

        Util.debug("Setting var: " + var + " to " + value + ", replacing "
                + oldValue);

When BLOG is run in non-verbose mode, Util.debug() is a noop. But the string concatenation above is still performed, and it wastes time and allocates a lot of small String objects which are then never used. (In my profiler run, this was one of the top object-allocation hot spots.)

Possible solutions:

http://stackoverflow.com/a/2466662/744071
http://stackoverflow.com/a/6023505/744071
http://stackoverflow.com/a/6016955/744071

@cberzan
Copy link
Contributor Author

cberzan commented May 23, 2014

@lileicc fixed this in #122.

@cberzan cberzan closed this as completed May 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant