Author Topic: ClearFileCache: full vs buffered read  (Read 135 times)

jj2007

  • Member
  • *****
  • Posts: 7884
  • Assembler is fun ;-)
    • MasmBasic
ClearFileCache: full vs buffered read
« on: December 29, 2017, 05:20:13 AM »
First attachment uses the new ClearFileCache macro. In the second one, it is disabled. Drag any fat file over the exe to test your disk I/O behaviour.

Code: [Select]
Non-cached buffered read vs full read with Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz:
Reading C:\Masm32\MasmBasic\AscUser\FatFile.txt
full read:
40473920 bytes, 12.2 ms/MB
40473920 bytes, 11.5 ms/MB
40473920 bytes, 11.5 ms/MB
40473920 bytes, 11.9 ms/MB
40473920 bytes, 12.1 ms/MB

buffered reads:
40472576 bytes read with buffersize 4096, 11.6 ms/MB
40472576 bytes read with buffersize 4096, 11.3 ms/MB

40468480 bytes read with buffersize 8192, 11.4 ms/MB
40468480 bytes read with buffersize 8192, 11.5 ms/MB

40468480 bytes read with buffersize 16384, 11.1 ms/MB
40468480 bytes read with buffersize 16384, 11.3 ms/MB

40468480 bytes read with buffersize 32768, 11.2 ms/MB
40468480 bytes read with buffersize 32768, 11.2 ms/MB

40435712 bytes read with buffersize 65536, 11.2 ms/MB
40435712 bytes read with buffersize 65536, 11.2 ms/MB

40370176 bytes read with buffersize 131072, 11.1 ms/MB
40370176 bytes read with buffersize 131072, 10.9 ms/MB

40370176 bytes read with buffersize 262144, 10.9 ms/MB
40370176 bytes read with buffersize 262144, 10.9 ms/MB

40370176 bytes read with buffersize 524288, 11.0 ms/MB
40370176 bytes read with buffersize 524288, 11.2 ms/MB

39845888 bytes read with buffersize 1048576, 11.7 ms/MB
39845888 bytes read with buffersize 1048576, 11.9 ms/MB

39845888 bytes read with buffersize 2097152, 10.9 ms/MB
39845888 bytes read with buffersize 2097152, 12.7 ms/MB
« Last Edit: December 29, 2017, 06:24:12 AM by jj2007 »

jj2007

  • Member
  • *****
  • Posts: 7884
  • Assembler is fun ;-)
    • MasmBasic
Really fast Sinus()
« Reply #1 on: December 31, 2017, 11:33:11 AM »
Code: [Select]
Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz (SSE4)

8274    cycles for 100 * fsin
1812    cycles for 100 * fsqrt(0.5)
1257    cycles for 100 * fast Sinus
4635    cycles for 100 * Sin6th

8279    cycles for 100 * fsin
1808    cycles for 100 * fsqrt(0.5)
1254    cycles for 100 * fast Sinus
4623    cycles for 100 * Sin6th

8368    cycles for 100 * fsin
1818    cycles for 100 * fsqrt(0.5)
1271    cycles for 100 * fast Sinus
4625    cycles for 100 * Sin6th

8298    cycles for 100 * fsin
1814    cycles for 100 * fsqrt(0.5)
1252    cycles for 100 * fast Sinus
4639    cycles for 100 * Sin6th

8357    cycles for 100 * fsin
1813    cycles for 100 * fsqrt(0.5)
1261    cycles for 100 * fast Sinus
4630    cycles for 100 * Sin6th

14      bytes for fsin
22      bytes for fsqrt(0.5)
17      bytes for fast Sinus
136     bytes for Sin6th

0.7071067811865475 = fsin
0.7071067811865476 = fsqrt(0.5)
0.7071067811865476 = fast Sinus
0.7077356557377049 = Sin6th

Siekmanski

  • Member
  • *****
  • Posts: 1169
Re: ClearFileCache: full vs buffered read
« Reply #2 on: December 31, 2017, 03:35:09 PM »
Code: [Select]
Intel(R) Core(TM) i7-4930K CPU @ 3.40GHz (SSE4)

10162   cycles for 100 * fsin
1544    cycles for 100 * fsqrt(0.5)
1481    cycles for 100 * fast Sinus
5576    cycles for 100 * Sin6th

10153   cycles for 100 * fsin
1544    cycles for 100 * fsqrt(0.5)
1480    cycles for 100 * fast Sinus
5574    cycles for 100 * Sin6th

10152   cycles for 100 * fsin
1544    cycles for 100 * fsqrt(0.5)
1478    cycles for 100 * fast Sinus
5572    cycles for 100 * Sin6th

10151   cycles for 100 * fsin
1542    cycles for 100 * fsqrt(0.5)
1477    cycles for 100 * fast Sinus
5570    cycles for 100 * Sin6th

10155   cycles for 100 * fsin
1544    cycles for 100 * fsqrt(0.5)
1483    cycles for 100 * fast Sinus
5570    cycles for 100 * Sin6th

14      bytes for fsin
22      bytes for fsqrt(0.5)
17      bytes for fast Sinus
136     bytes for Sin6th

0.7071067811865475 = fsin
0.7071067811865476 = fsqrt(0.5)
0.7071067811865476 = fast Sinus
0.7077356557377049 = Sin6th

--- ok ---

caballero

  • Member
  • ****
  • Posts: 825
    • Abre Ojos Ensamblador
Re: ClearFileCache: full vs buffered read
« Reply #3 on: December 31, 2017, 10:40:15 PM »
Code: [Select]
Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz (SSE4)

8731    cycles for 100 * fsin
1925    cycles for 100 * fsqrt(0.5)
1351    cycles for 100 * fast Sinus
4850    cycles for 100 * Sin6th

8704    cycles for 100 * fsin
1963    cycles for 100 * fsqrt(0.5)
1330    cycles for 100 * fast Sinus
4871    cycles for 100 * Sin6th

8742    cycles for 100 * fsin
1918    cycles for 100 * fsqrt(0.5)
1326    cycles for 100 * fast Sinus
4962    cycles for 100 * Sin6th

8116    cycles for 100 * fsin
1777    cycles for 100 * fsqrt(0.5)
1325    cycles for 100 * fast Sinus
5026    cycles for 100 * Sin6th

8982    cycles for 100 * fsin
1971    cycles for 100 * fsqrt(0.5)
1577    cycles for 100 * fast Sinus
5225    cycles for 100 * Sin6th

14      bytes for fsin
22      bytes for fsqrt(0.5)
17      bytes for fast Sinus
136     bytes for Sin6th

0.7071067811865475 = fsin
0.7071067811865476 = fsqrt(0.5)
0.7071067811865476 = fast Sinus
0.7077356557377049 = Sin6th

--- ok ---
En un lugar de la Mancha de cuyo nombre no quiero acordarme

LiaoMi

  • Member
  • **
  • Posts: 193
Re: ClearFileCache: full vs buffered read
« Reply #4 on: December 31, 2017, 10:49:20 PM »
Code: [Select]
Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz (SSE4)

8119 cycles for 100 * fsin
1210 cycles for 100 * fsqrt(0.5)
1163 cycles for 100 * fast Sinus
4395 cycles for 100 * Sin6th

8519 cycles for 100 * fsin
1216 cycles for 100 * fsqrt(0.5)
1138 cycles for 100 * fast Sinus
4637 cycles for 100 * Sin6th

9406 cycles for 100 * fsin
1237 cycles for 100 * fsqrt(0.5)
1198 cycles for 100 * fast Sinus
4836 cycles for 100 * Sin6th

8397 cycles for 100 * fsin
1234 cycles for 100 * fsqrt(0.5)
1151 cycles for 100 * fast Sinus
4205 cycles for 100 * Sin6th

8344 cycles for 100 * fsin
1231 cycles for 100 * fsqrt(0.5)
1148 cycles for 100 * fast Sinus
4237 cycles for 100 * Sin6th

14 bytes for fsin
22 bytes for fsqrt(0.5)
17 bytes for fast Sinus
136 bytes for Sin6th

0.7071067811865475 = fsin
0.7071067811865476 = fsqrt(0.5)
0.7071067811865476 = fast Sinus
0.7077356557377049 = Sin6th

--- ok ---

jj2007

  • Member
  • *****
  • Posts: 7884
  • Assembler is fun ;-)
    • MasmBasic
Re: ClearFileCache: full vs buffered read
« Reply #5 on: December 31, 2017, 11:24:41 PM »
fsin vs Sinus(): ca. 8120/1150 - that's a factor 7 on the i7 :t

P.S.: The last one, Sin6th, is by eukalyptus