โดยผลทดสอบที่ได้คือ
Mean clock time not use pipeline : 0.0078674975
Mean clock time using pipeline : 0.00783607
จะพบว่าเวลาของทั้ง 2 วิธีนั้นใกล้เคียงกันมาก ซึ่งจากผลที่ได้สามารถสรุปในเชิงเบื้องต้นได้ว่าการปรับปรุงระบบโดยใช้ Multiprocessing และ Pipeline Program เข้ามาเสริมการทำงานนั้นยังส่งผลได้ไม่ดีเท่าที่ควร
โค้ดที่ใช้สำหรับทดสอบ
import csv
dataset = 400
with open('clocK time delay.csv') as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
clock_delay = []
for row in readCSV: # print(row[4])
clock_delay.append(float(row[4]))
delay_sum = 0
for i in range(dataset):
delay_sum += clock_delay[i]
print("Mean clock time not use pipeline : %s" % (delay_sum/dataset))
with open('clock time pipeline.csv') as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
clock_pipeline = []
for row in readCSV:
clock_pipeline.append(float(row[1]))
pipeline_sum = 0
for i in range(dataset):
pipeline_sum += clock_pipeline[i]
print("Mean clock time using pipeline : %s" % (pipeline_sum/dataset))
dataset = 400
with open('clocK time delay.csv') as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
clock_delay = []
for row in readCSV: # print(row[4])
clock_delay.append(float(row[4]))
delay_sum = 0
for i in range(dataset):
delay_sum += clock_delay[i]
print("Mean clock time not use pipeline : %s" % (delay_sum/dataset))
with open('clock time pipeline.csv') as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
clock_pipeline = []
for row in readCSV:
clock_pipeline.append(float(row[1]))
pipeline_sum = 0
for i in range(dataset):
pipeline_sum += clock_pipeline[i]
print("Mean clock time using pipeline : %s" % (pipeline_sum/dataset))
ไม่มีความคิดเห็น:
แสดงความคิดเห็น