Jordan Lee [Sat, 28 May 2011 01:34:07 +0000 (01:34 +0000)]
(trunk gtk) #4014 "409 error when opening .../transmission/web without trailing '/'" -- use suggestion from Mezz to have the "open web client" button in the GTK+ client follow the same URL as the Qt client
Jordan Lee [Thu, 12 May 2011 06:43:40 +0000 (06:43 +0000)]
(trunk libT) fix magnet link crash in peer-msgs.c's updateDesiredRequestCount() reported by quinx in the forums.
In some odd cases (such as if unchoked without having shown interest), the code could dividing a number by the torrent's block size without checking to see if the torrent had its metadata yet. This caused a division by zero because a magnet torrent's blocksize is unset until the metadata is downloaded.
Jordan Lee [Tue, 10 May 2011 04:46:44 +0000 (04:46 +0000)]
(trunk libT) CPU improvement in torrent.c's torrentInit()
Add the new torrent to the session's torrent list by prepending it instead of appending it. That way we don't have to walk the list in order to add it. tr_session.torrentList is an unordered list, so there's no real difference between prepending and appending.
Jordan Lee [Tue, 10 May 2011 03:50:54 +0000 (03:50 +0000)]
(trunk libT) CPU optimization in peer-mgr.c's rechokeDownloads()
Instead of recalculating interesting pieces for each peer we loop through, calculate them just once into a bitfield and then reuse that bitfield inside the loop.
Jordan Lee [Tue, 10 May 2011 01:51:12 +0000 (01:51 +0000)]
(trunk libT) CPU improvement in peer-mgr.c's getPeerCandidates()
getPeerCandiates() used to read through all the torrents to determine the global peer connections, and then again to determine the global peer candidates. Now this is done in one loop instead of two.
Jordan Lee [Mon, 9 May 2011 04:16:49 +0000 (04:16 +0000)]
(trunk libT) CPU optimization in tr_bandwidthClamp().
Don't call tr_time_msec() if it's not necessary. This was one of the top CPU sinks in profiling, so removing it is a nice improvement in cases when it's not necessary, such as when speed limiting is disabled.
Jordan Lee [Wed, 4 May 2011 21:38:01 +0000 (21:38 +0000)]
(trunk libT) #2338 "Add uTP support" -- increase the block bandwidth to 3000 bytes in phase 1 as suggested by jch in comment:120.
The rationale is that by using 3000 bytes we'll send one full-size frame straight away, and leave enough buffered data for the next frame to go out in a timely manner.
Jordan Lee [Sun, 1 May 2011 19:10:34 +0000 (19:10 +0000)]
(trunk libT) the functions tr_peerMsgsSetChoke() and tr_peerMsgsSetInterested() have bool arguments whose types never got switched from "int" to "bool" when "bool" was adopted.
Jordan Lee [Fri, 29 Apr 2011 20:22:11 +0000 (20:22 +0000)]
(trunk gtk) tweak to r12398: because most of the strings in category_filter_model_update() will be duplicates of each other, use g_string_chunk_insert_const() instead of g_string_insert().
Jordan Lee [Thu, 28 Apr 2011 18:40:46 +0000 (18:40 +0000)]
(trunk libT) tr_torrentGetFileMTime(): if the file being looked at is aleady open in fdlimit's file cache, use that cached handle instead of deriving our own.
Jordan Lee [Wed, 27 Apr 2011 21:38:45 +0000 (21:38 +0000)]
(trunk libT) heap pruning: use tr_bencToBuf() instead of tr_bencToStr() when building LTEP messages. This saves us from a handful of unnecessary malloc+memcpy+free calls in each instance where the change is made.
Jordan Lee [Wed, 27 Apr 2011 20:52:07 +0000 (20:52 +0000)]
(trunk libT) heap pruning: using the same mechanism as in r12388, avoid an unnecessary malloc+memcpy+free when building the URL for a webseed download request
Jordan Lee [Wed, 27 Apr 2011 20:50:43 +0000 (20:50 +0000)]
(trunk libT) heap pruning: using the same mechanism as in r12388, avoid an unnecessary malloc+memcpy+free when TR_CURL_VERBOSE is logging HTTP messages
Jordan Lee [Wed, 27 Apr 2011 20:41:47 +0000 (20:41 +0000)]
(trunk libT) heap pruning: avoid unnecessary malloc+memcpy+frees in announcer.
1. when creating announce URLs in announcer-http.c
2. when creating scrape URLs in announcer-http.c
3. when deep-logging what announces are in a torrent's queue in announcer.c
Jordan Lee [Wed, 27 Apr 2011 05:29:05 +0000 (05:29 +0000)]
(trunk libT) #4209 "Shortcut UDP tracker test" -- prioritize the UDP handler functions based on frequency (uTP, DHT, UTP tracker) as outlined by jch in comment:5. Also, don't call the uTP or DHT handlers when uTP or DHT is disabled in the system preferences.
To avoid the function call overhead described by jch, instead of calling tr_sessionIsUTPEnabled() and tr_sessionIsDHTEnabled(), we test for WITH_UTP to be defined and test the tr_session.isUTPEnabled and tr_session.isDHTEnabled flags directly.
Jordan Lee [Wed, 27 Apr 2011 05:03:10 +0000 (05:03 +0000)]
(trunk libT) #4209 "Shortcut UDP tracker test" -- the goal of #4209 is to minimize the cost of the UDP event callback function, so apply the heap pruning eye to that by removing an unnecessary malloc/free call there.
Previously we allocated a 4096 character buffer each time; now we allocate it on the stack. It seems all the distros and OS flavors that Transmission runs on have multi-MB default stack sizes, so a hardwired 4K array should be safe.