Error in file system
Posted: Fri Jul 17, 2015 10:36 am
The test records in Flash.
It writes half the size of a flash
------------------------------------------------
Total : 3396281 bytes
Used : 0 bytes
Remain: 3396281 bytes
------------------------------------------
> dofile('main0.lua')
------------------------------------------
name=x1.txt,E=30000000
TT=5.5,ts=13.2,s=160.04
TT=11.2,ts=13.2,s=320.108
TT=16.8,ts=13.2,s=480.077
TT=22.5,ts=16.5,s=640.162
TT=28.1,ts=16.5,s=800.111
TT=33.8,ts=13.1,s=960.129
TT=39.5,ts=13.2,s=1120.11
TT=45.1,ts=13.2,s=1280.058
TT=50.8,ts=14.1,s=1440.049
TT=56.5,ts=13.1,s=1600.026
HЎЦФф
--------------------------------------------
Total : 3396281 bytes
Used : 1689983 bytes
Remain: 1706298 bytes
--------------------------------------------------------
Test :
--------------------------------
function main0()
local E=30000000; local E1=2;
for m=1,E1 do
local s=0; local n=1; local tt=0; local T2=tmr.now(); T2=tmr.now()-T2;
local name="x1.txt";
print("name="..name..",E="..E);
if file.open(name,"w") then
while E>s do
local str=tostring(math.random ());
local len=string.len(str);
tmr.wdclr()
local TM=tmr.now(); file.write(str); local y=tmr.now()-TM-T2; tt=tt+y;
n=n+1; s=s+len;
if n>10000 then print("TT="..0.1*math.floor(tt/100000)..",ts="..0.1*math.floor(10*y/len)..",s="..(s/1000)); n=1; end
end
end
end
end
main0()
It writes half the size of a flash
------------------------------------------------
Total : 3396281 bytes
Used : 0 bytes
Remain: 3396281 bytes
------------------------------------------
> dofile('main0.lua')
------------------------------------------
name=x1.txt,E=30000000
TT=5.5,ts=13.2,s=160.04
TT=11.2,ts=13.2,s=320.108
TT=16.8,ts=13.2,s=480.077
TT=22.5,ts=16.5,s=640.162
TT=28.1,ts=16.5,s=800.111
TT=33.8,ts=13.1,s=960.129
TT=39.5,ts=13.2,s=1120.11
TT=45.1,ts=13.2,s=1280.058
TT=50.8,ts=14.1,s=1440.049
TT=56.5,ts=13.1,s=1600.026
HЎЦФф
--------------------------------------------
Total : 3396281 bytes
Used : 1689983 bytes
Remain: 1706298 bytes
--------------------------------------------------------
Test :
--------------------------------
function main0()
local E=30000000; local E1=2;
for m=1,E1 do
local s=0; local n=1; local tt=0; local T2=tmr.now(); T2=tmr.now()-T2;
local name="x1.txt";
print("name="..name..",E="..E);
if file.open(name,"w") then
while E>s do
local str=tostring(math.random ());
local len=string.len(str);
tmr.wdclr()
local TM=tmr.now(); file.write(str); local y=tmr.now()-TM-T2; tt=tt+y;
n=n+1; s=s+len;
if n>10000 then print("TT="..0.1*math.floor(tt/100000)..",ts="..0.1*math.floor(10*y/len)..",s="..(s/1000)); n=1; end
end
end
end
end
main0()