Alo Sarv
lead developer

Donate via

Latest Builds

version 0.3
tar.gz tar.bz2
Boost 1.33.1 Headers
MLDonkey Downloads Import Module Development
Payment completed
Development in progress.
Developer's Diary

Wednesday, November 30, 2005

API changes, and misc changes

Two important API changes were made today - PartData::getRange() and getLock() methods no longer throw exceptions when failing to generate a range (and return null pointer instead), and Config::read() no longer throws exceptions on invalid configuration vaules, but logs a warning and returns default value instead. The rationale behind both of these changes was that expected failures should not generate exceptions; exceptions should only be used for unexpected failures. The additional reasoning behind the first change was that we were throwing/catching exceptions in getRange() inner loops, which potentially meant throwing/catching hundreds, perhaps even thousands of exceptions while looping over chunks, which became a serious performance bottleneck. Exceptions in inner loops are evil.

There were few more API changes made few days ago, but I got carried away in that blog entry; those were change of EventTableBase::handlePending and EventMain::handlePending function renames to process(), which is more generic, and based on that, the moving of SocketWatcher (which performs sockets polling) derivation from EventMain, overriding the process() method, rationale being more generic and logical. This also had the effect of removing the need to call SocketWatcher::poll() explicity from main loop, since that's now done automatically from EventMain.

Another change that was done recently was reducing the fluctuations of transfer rates (both in statusbar and in 'vd' output). Previously, the transfer rates dispalyed were the amount transfered during last 1 second; now we display the average of last 3 seconds, which shows more stable transfer rates. It seems that other clients (eMule, Azureus) show even further averaged transfer rates, for 5-6 seconds at least, so we might tweak that more in the future.

Madcat, ZzZz

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?