This week's book giveaways are in the Jython/Python and Object-Oriented programming forums. We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line! See this thread and this one for details.
Would anyone happen to know of good Loggers, that are *really* optimized for performance ?
We're migrating an appliction from C, with crazy demands on performace, on a relatively weak machine... we actually got to the point of tinkering with the Garbage collection, and using Optimizeit very often...
So, we're looking for a logger with features such as:
1. Something like log4J Async File Appender (separate thread does the IO). It would be nice to have some more configurability - e.g. if the logging queue gets full, we'd rather dismiss some log records, than get stuck on waiting.
2. Very careful memory management (I'm not sure, but I think log4j allocates 'LogRecords' or some similar type of class, which means it's hard of the Garbage collection... We'd rather miss some functionalilty (nice formatting, accurate date), than hurt performance...
Originally posted by Sol Mam-Orn: . . . on a relatively weak machine...
Have you considered a hardware upgrade? You could probably get orders-of-magnitude improvement by getting an upgrade for (let's be extravagant here) a couple thousand dollars. You aren't going to get that kind of improvement tinkering with a logging implementation no matter how long you work on it. Developer time is way more expensive than computer equipment. Do a cost-benefit analysis and forget about tinkering.
One got to be very careful when calling the System.gc as when the garbage collector is operating, the actual program execution on the JVM pauses. (GC and your program does not execute in parallel).
If you want to conserve memory, I would suggest you design your classes carefully and the object instantiation. Simple practices like, avoiding the creation of object references within loops and usage of StringBuffer instead of String could do a lot of difference in this aspect.
However, if you are interested in conserving the CPU time I suggest that invoking the Garbage collector is a relatively poor option. You can hint the Garbage Collector to do the job automatically by setting your unused object references to null.
If Log4J is too heavy for your resource limits you can always use java.util.logging.Logger, of cause with the limited flexibilities. [ June 06, 2006: Message edited by: Isuru Sampath ]
No Winds No Waves
This. Exactly this. This is what my therapist has been talking about. And now with a tiny ad: