Small performance improvements.

This commit is contained in:
Martin Edenhofer 2012-08-07 23:53:43 +02:00
parent 7228b0d319
commit ce6317c520

View file

@ -61,6 +61,9 @@ module Session
client_ids = self.sessions client_ids = self.sessions
client_ids.each { |client_id| client_ids.each { |client_id|
# connection already open
next if @@client_threads[client_id]
# get current user # get current user
user_session = Session.get( client_id ) user_session = Session.get( client_id )
next if !user_session next if !user_session
@ -81,7 +84,7 @@ module Session
# wait with client thread unil user thread has done some little work # wait with client thread unil user thread has done some little work
if start_user_thread if start_user_thread
sleep 0.4 sleep 0.5
end end
# start client thread # start client thread
@ -484,7 +487,7 @@ class ClientState
# start faster in the beginnig # start faster in the beginnig
if loop_count < 20 if loop_count < 20
sleep 0.4 sleep 0.6
else else
sleep 1 sleep 1
end end