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

jj2007

  • Member
  • *****
  • Posts: 8736
  • 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: 8736
  • 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: 1648
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 ---
Creative coders use backward thinking techniques as a strategy.

caballero

  • Member
  • *****
  • Posts: 1085
    • 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

- There are 10 kind of people: those who know binary numbers and those who don't -

LiaoMi

  • Member
  • ***
  • Posts: 304
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: 8736
  • 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

jj2007

  • Member
  • *****
  • Posts: 8736
  • Assembler is fun ;-)
    • MasmBasic
NoTag$()
« Reply #6 on: January 23, 2018, 09:00:48 AM »
include \masm32\MasmBasic\MasmBasic.inc         ; download
  Init
  Let esi=NoTag$(FileRead$("https://www.freebasic.net/forum/viewtopic.php?f=3&t=26313"))
  FileWrite "test.txt", esi
EndOfCode


Result:

Remove non-text tags from HTML and save to string - freebasic.net
freebasic.net
FreeBASIC's Official Forums Skip to content Search Advanced search Quick links Unanswered topics Active topics Search Forums Members The team FAQ Login Register Search Login Register Board index Programming General Search
It is currently Jan 22, 2018 21:58
All times are UTC Remove non-text tags from HTML and save to string General FreeBASIC programming questions.
Post Reply Search Advanced search 2 posts • Page 1 of 1 dbickin Posts: 32 Joined: Aug 03, 2005 16:40 Remove non-text tags from HTML and save to string
Quote Post by dbickin » Jan 22, 2018 21:39 Is there a library that will remove the tags from html (except that <P> and <BR> should be changed to new lines) and save the results in a string?
I don't want to reinvent the wheel if someone has already written such a function.
Thanks,
David Top jj2007 Posts: 303 Joined: Oct 23, 2016 15:28 Location: Roma, Italia Contact: Contact jj2007 Website Re: Remove non-text tags from HTML and save to string
Quote Post by jj2007 » Jan 22, 2018 21:56 There is NoTag$(pHtmltext) . I could extract a DLL. Are you on Windows? Top Display posts from previous: All posts 1 day 7 days 2 weeks 1 month 3 months 6 months 1 year Sort by Author Post time Subject Ascending Descending Post Reply 2 posts • Page 1 of 1 Return to “General” Jump to
FreeBASIC
News
Community Discussion
Projects
Tips and Tricks
Programming
Beginners
General
Hardware Interfaces / Communication
Libraries
Game Dev
Platforms
DOS
Linux
Windows
Misc
Documentation Who is online
Users browsing this forum: jj2007 , Josep Roca and 7 guests Board index All times are UTC Delete all board cookies The team Contact us Powered by phpBB ® Forum Software © phpBB Limited
Style by Arty