Python?е????????????????Ч???????
???????? ???????[ 2016/11/17 11:23:31 ] ????????Python ???
????(8)????????????????????????????????
????<code class="python">t = time.time()
????ios = []
????t = time.time()
????for x in range(10):
????thread = Thread(target=http_request)
????ios.append(thread)
????thread.start()
????e = ios.__len__()
????while True:
????for th in ios:
????if not th.is_alive():
????e -= 1
????if e <= 0:
????break
????print("Thread Http Request"?? time.time() - t)</code>
????Output: 0.7419998645782471??0.3839998245239258??0.3900001049041748
????(9)??????????????CPU??????????????
????<code class="python">counts = []
????t = time.time()
????for x in range(10):
????process = Process(target=count?? args=(1??1))
????counts.append(process)
????process.start()
????e = counts.__len__()
????while True:
????for th in counts:
????if not th.is_alive():
????e -= 1
????if e <= 0:
????break
????print("Multiprocess cpu"?? time.time() - t)</code>
????Output: 54.342000007629395??53.437999963760376
????(10)??????????????IO????????
????<code class="python">t = time.time()
????ios = []
????t = time.time()
????for x in range(10):
????process = Process(target=io)
????ios.append(process)
????process.start()
????e = ios.__len__()
????while True:
????for th in ios:
????if not th.is_alive():
????e -= 1
????if e <= 0:
????break
????print("Multiprocess IO"?? time.time() - t)</code>
????Output: 12.509000062942505??13.059000015258789
????(11)??????????????Http????????????
????<code class="python">t = time.time()
????httprs = []
????t = time.time()
????for x in range(10):
????process = Process(target=http_request)
????ios.append(process)
????process.start()
????e = httprs.__len__()
????while True:
????for th in httprs:
????if not th.is_alive():
????e -= 1
????if e <= 0:
????break
????print("Multiprocess Http Request"?? time.time() - t)</code>
????Output: 0.5329999923706055??0.4760000705718994
????????? CPU???????? IO???????? ???????????????? ??????? 94.91824996469 22.46199995279 7.3296000004 ???????? 101.1700000762 24.8605000973 0.5053332647 ???????? 53.8899999857 12.7840000391 0.5045000315
????????????????????????????
???????????IO?????????????????к???????????IO????????????????Щ????????????????CPU?????????????????????????????????????????????????????????????????????????????????????????
?????????????????CPU????????IO?????????????????????????????????????????????У????????????????????????????????????????????????????????????????????????CPU??????????????????????£????????????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Java??????????????Java??????interrupt?ж????????????????????Java????Java???????????java????????????java???????????????????Java 4??????????Linux???????????Java???????????Java????5????ü???Java????????????????C???????pthread???????Java????????????????Java???????????Linux C???????Java ??? ? ConcurrentLinkedQueue
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????