The present invention provides a method for read/write speed testing, comprising: obtaining a test speed of reading data from or writing data to each of a plurality of memories, the plurality of memories including a random access memory and at least one buffer memory associated with the random access memory; and determining an actual speed of reading data from or writing data to the random access memory according to the test speed of reading data from or writing data to the each memory. Embodiments of the present invention further disclose an apparatus for read/write speed testing and electronic device. With the embodiments of the present invention, the read/write speed of the random access memory can be tested more accurately.
Legal claims defining the scope of protection, as filed with the USPTO.
1. A method for read/write speed testing applied to an electronic device, comprising: obtaining a test speed of reading data from or writing data to each of a plurality of memories, the plurality of memories comprising a random access memory and at least one buffer memory associated with the random access memory; and determining an actual speed of reading data from or writing data to the random access memory according to the test speed of reading data from or writing data to the each memory; wherein determining an actual speed of reading data from or writing data to the random access memory according to the test speed of reading data from or writing data to the each memory comprises: calculating a weighted average value of test speeds of reading data from or writing data to the plurality of memories; and determining the weighted average value as the actual speed of reading data from or writing data to the random access memory.
2. The method of claim 1 , wherein obtaining a test speed of reading data from or writing data to each of the plurality of memories comprises: performing a plurality of tests on each of the memories to obtain a test result of each test; and determining an average value of test results of the plurality of tests as the test speed of reading data from or writing data to the each memory.
3. The method of claim 2 , wherein obtaining a test result of each test comprises: obtaining a data size for a test for the each memory, and duration for reading data of the data size from or writing data of the data size to the each memory; and determining the test result of the each test for the each memory according to the data size and the duration.
4. The method of claim 3 , wherein determining a test result of the each test for the each memory according to the data size and the duration comprises: determining a value obtained by dividing the data size by the duration as the test result of the each test for the each memory.
5. The method of claim 2 , wherein obtaining a test result of the each test comprises: performing a test simultaneously on the each memory using two threads; obtaining a test speed component obtained by each of the two threads; and determining a sum of the test speed components obtained by the two threads as the test result of the each memory.
6. The method of claim 5 , wherein the two threads use a thread lock.
7. An electronic device, comprising a processor, a memory, a communication interface and a bus; the processor, the memory and the communication interface are connected and communicated with each other via the bus; the memory stores executable program code; the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, to perform a process comprising: obtaining a test speed of reading data from or writing data to each of a plurality of memories, the plurality of memories comprising a random access memory and at least one buffer memory associated with the random access memory; and determining an actual speed of reading data from or writing data to the random access memory according to the test speed of reading data from or writing data to the each memory; wherein determining an actual speed of reading data from or writing data to the random access memory according to the test speed of reading data from or writing data to the each memory comprises: calculating a weighted average value of test speeds of reading data from or writing data to the plurality of memories; and determining the weighted average value as the actual speed of reading data from or writing data to the random access memory.
8. The electronic device according to claim 7 , wherein obtaining a test speed of reading data from or writing data to each of the plurality of memories comprises: performing a plurality of tests on each of the memories to obtain a test result of each test; and determining an average value of test results of the plurality of tests as the test speed of reading data from or writing data to the each memory.
9. The electronic device according to claim 7 , wherein obtaining a test result of each test comprises: obtaining a data size for a test for the each memory, and duration for reading data of the data size from or writing data of the data size to the each memory; and determining the test result of the each test for the each memory according to the data size and the duration.
10. The electronic device according to claim 7 , wherein determining a test result of the each test for the each memory according to the data size and the duration comprises: determining a value obtained by dividing the data size by the duration as the test result of the each test for the each memory.
11. The electronic device according to claim 7 , wherein obtaining a test result of the each test comprises: performing a test simultaneously on the each memory using two threads; obtaining a test speed component obtained by each of the two threads; and determining a sum of the test speed components obtained by the two threads as the test result of the each memory.
12. The electronic device according to claim 7 , wherein the two threads use a thread lock.
13. A non-transitory computer-readable storage medium, storing multiple instructions which can be loaded by a processor to perform a process comprising: obtaining a test speed of reading data from or writing data to each of a plurality of memories, the plurality of memories comprising a random access memory and at least one buffer memory associated with the random access memory; and determining an actual speed of reading data from or writing data to the random access memory according to the test speed of reading data from or writing data to the each memory; wherein determining an actual speed of reading data from or writing data to the random access memory according to the test speed of reading data from or writing data to the each memory comprises: calculating a weighted average value of test speeds of reading data from or writing data to the plurality of memories; and determining the weighted average value as the actual speed of reading data from or writing data to the random access memory.
14. The non-transitory computer-readable storage medium according to claim 13 , wherein obtaining a test speed of reading data from or writing data to each of the plurality of memories comprises: performing a plurality of tests on each of the memories to obtain a test result of each test; and determining an average value of test results of the plurality of tests as the test speed of reading data from or writing data to the each memory.
15. The non-transitory computer-readable storage medium according to claim 13 , wherein obtaining a test result of each test comprises: obtaining a data size for a test for the each memory, and duration for reading data of the data size from or writing data of the data size to the each memory; and determining the test result of the each test for the each memory according to the data size and the duration.
16. The non-transitory computer-readable storage medium according to claim 13 , wherein determining a test result of the each test for the each memory according to the data size and the duration comprises: determining a value obtained by dividing the data size by the duration as the test result of the each test for the each memory.
17. The non-transitory computer-readable storage medium according to claim 13 , wherein obtaining a test result of the each test comprises: performing a test simultaneously on the each memory using two threads; obtaining a test speed component obtained by each of the two threads; and determining a sum of the test speed components obtained by the two threads as the test result of the each memory.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
July 10, 2018
May 5, 2020
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.