﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30707	why it took 30s when call sorted function in django server sometimes.	liumilan	nobody	"I add some logic in django . And when i sent requests to server,i found some requests are handled so slowly,and then find it will take much time when call sorted function.But it is stranged that if i sent this wired data to server alone,it is ok,only take 100ms.Does the sorted function has confict with django?


{{{
def recall(word):
        dict_result = {}
        word_fields = word.split("":"")
        for i in range(0,len(word_fields)):
                generate(dict_resut)
        pre_result = sorted(dict_result.items(), key=operator.itemgetter(1),reverse=True)

        return recall_tag[:-1]

client code is:
  for line in sys.stdin:
                line = line.rstrip('\n')
                fields = line.split(""\t"")
                id = fields[0]
                title = fields[1]
                page_params_mq = {'id':vid,'title':title}
                try :
                        rec_mq_res = get_rec(server_ip_mq, server_port_mq, web_page_mq, page_params_mq)
                except:
                        print (line)
}}}
I run
cat test_data|python client.py
if there is only one data in test_data file,it is ok.If there are many data,it will occur randomly slowly 
"	Bug	closed	Core (Other)	dev	Normal	invalid	sorted function		Unreviewed	0	0	0	0	0	0
