-
Notifications
You must be signed in to change notification settings - Fork 65
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
Possible performance improvement for high frequency logging using EquinoxLogWriter #221
Comments
The log writing code itself predates even Equinox. IIRC the current behavior be necessary for things like the PDE log viewer so that it gets notified when the content of the file changes. At the least we need to make sure the content is flushed to disk each entry write I think. |
@tjwatson i think Regarding the So i think that such a change should not affect the |
If different classes access the same file, one only needs to make sure it can be shared (e.g. windows don't like to write a file that is currently opened by another process) so this should be checked both on windows/linux to work smoothly. |
The log is either instance specific with a unique name contained in the framework storage area, or it has been set to the |
@alxflam-work best way to get this done is to open a PR with your suggested changes. Thanks. |
This issue has been inactive for 180 days and is therefore labeled as stale. |
Closes eclipse-equinox#221. The eager behavior can be enabled by setting configuration eclipse.log.closeFile.eagerClose to true (defaults to false).
invocation" This reverts commit 53dc6b6 as it caused test failures in - org.eclipse.core.tests.internal.runtime.LogSerializationTest - org.eclipse.equinox.p2.tests.mirror.ArtifactMirrorApplicationTest - org.eclipse.equinox.p2.tests.mirror.NewMirrorApplicationArtifactTest Note: pom and manifest files are left unchanged to avoid going back with bundle versions. Original PR: eclipse-equinox#382 Original ticket: eclipse-equinox#221
invocation" This reverts commit 53dc6b6 as it caused test failures in - org.eclipse.core.tests.internal.runtime.LogSerializationTest - org.eclipse.equinox.p2.tests.mirror.ArtifactMirrorApplicationTest - org.eclipse.equinox.p2.tests.mirror.NewMirrorApplicationArtifactTest Note: pom and manifest files are left unchanged to avoid going back with bundle versions. Original PR: #382 Original ticket: #221
This issue has been inactive for 180 days and is therefore labeled as stale. |
Hi,
i've been taking a look at EquinoxLogWriter recently and noticed the following behavior:
log(FrameworkLogEntry logEntry)
always creates a newBufferedWriter
with a newFileOutputStream
for the given log file as thefinally
block inlog
always sets thewriter
to null (closeFile
is called). If one makes heavy usage of logging, this can be a performance issue: Say you log a large number ofFrameworkLogEntry
s, then the FOS is opened and closed for every single log invocation.Wouldn't it be possible to improve performance by only re-creating the
BufferedWriter
when necessary:setOutput
is already called bysetFile
, therefore thewriter
is closed and set to nullcheckLogFileSize
already callssetOutput
and therefore ensures thewriter
is closed and set to null if the log file changesAs both
setFile
andlog
are synchronized, wouldn't it be possible to omit thecloseFile
call in thelog
method to keep thewriter
instance and thereby improving performance for consecutive log invocations? Sure, then there's an open FOS for the runtime of the equinox application, e.g. for the complete runtime of an eclipse RCP. But isn't that somewhat expectable for the log file? A newdispose
method may be required which can be called to free thewriter
and any other members, this could be called e.g. byEquinoxLogServices#stop
.What do you think - is this something that could be improved as outlined? I may just not spot the reason why the
writer
is not reused.Greetings,
Alex
The text was updated successfully, but these errors were encountered: