I finally got freenet.jar compiled and profiled. First, size-related
numbers:
Number of lines removed: ~5000
freenet.jar shrink: ~200k
And profiling data (see below for details):
freenet.support.FileLoggerHook$WriterThread.run: 8,35% (3)
freenet.support.Log.isLoggable: 0.09% (17)
freenet.support.Log.write: 0,03% (26)
These numbers come from a sanity check run, and _do not_ represent what
would happen in a real test run. Both were run in an empty directory for
a few minutes and then shut down. Of special note is the lack of the
seed nodes list, leaving out, I'd guess, 80% of fred code. Also, lazy
evaluation isn't used, so Log.write()'s share can be expected to rise.
There are still a few things to do before I can say whether predicates
are indispensable or not.
On 18-03-2012 20:40, Marco Schulze wrote:
One thing has been bothering me: those 'if (logMINOR)
Logger.minor(...', and the mess that logging is inside fred. I've
written a very simple replacement for Logger + associated classes with
the following changes:
- Log level (renamed to severity) filtering is done by Logging.log();
- Specific writer classes are replaced by a simple OutputStream, which
defaults to System.err. Formatting is also unified;
- Severity cases are broadened (FATAL, ERROR, WARNING, INFO, DEBUG and
TRACE), MINOR is mapped to DEBUG, and NORMAL is mapped to INFO;
- No logging method accepts an Object parameter - hashCode() is not
exactly useful.
Additionally, log rotation will be moved outside (possibly inside Node).
Currently, the log format is '<severity>\t<message>'.
_______________________________________________
Devl mailing list
[email protected]
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl