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.
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Very fast loggers ?

 
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...


Thanks very much.
 
Bartender
Posts: 9612
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
This. Exactly this. This is what my therapist has been talking about. And now with a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!