[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #51512] [octave forge] (io) Missing or wrong t
From: |
Markus Mützel |
Subject: |
[Octave-bug-tracker] [bug #51512] [octave forge] (io) Missing or wrong types when using xlsread with OCT interface |
Date: |
Sun, 13 Aug 2017 11:29:54 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0 |
Follow-up Comment #19, bug #51512 (project octave):
The last version seems to run at more or less the same speed as the version
before.
Your file (file #41434):
>> profile clear
>> profile on
>> tic; [~, ~, raw] = xlsread ("Excel2013_1001x999.xlsx", 1, "", "oct"); toc
combined regexps
Elapsed time is 95.3975 seconds.
>> profile off
>> profshow
# Function Attr Time (s) Time (%) Calls
---------------------------------------------------------------
54 regexp 62.753 66.04 1123
62 str2double 8.586 9.04 8
60 cat 4.837 5.09 1129
57 cellfun 3.533 3.72 10065
83 col2num 2.999 3.16 1999998
70 __OCT_xlsx2oct__ 2.996 3.15 1
79 strncmp 1.782 1.88 5
67 xls2oct 1.431 1.51 1
78 regexprep 1.206 1.27 6
47 system 1.201 1.26 1
87 strrep 1.032 1.09 5
72 num2cell 0.790 0.83 2
55 cell2mat 0.787 0.83 2234
5 ischar 0.302 0.32 1000038
66 postfix ' 0.114 0.12 6
27 strcmp 0.107 0.11 25
77 iscellstr 0.077 0.08 6
88 parsecell 0.073 0.08 1
82 clear 0.071 0.07 1
19 cell 0.066 0.07 6
My file (file #41352 + changes from comment #16):
>> profile clear
>> profile on
>> tic; [~, ~, raw] = xlsread ("Excel2013_1001x999.xlsx", 1, "", "oct"); toc
Elapsed time is 94.7151 seconds.
>> profile off
>> profshow
# Function Attr Time (s) Time (%) Calls
---------------------------------------------------------------
54 regexp 64.371 68.22 1128
62 str2double 9.943 10.54 8
60 cat 4.721 5.00 1132
57 cellfun 3.547 3.76 10083
77 col2num 3.005 3.19 1999998
70 __OCT_xlsx2oct__ 2.770 2.94 1
47 system 1.168 1.24 1
67 xls2oct 1.109 1.17 1
81 strrep 0.940 1.00 5
55 cell2mat 0.781 0.83 2239
71 num2cell 0.772 0.82 5
74 clear 0.517 0.55 6
5 ischar 0.312 0.33 1000022
66 postfix ' 0.081 0.09 9
82 parsecell 0.073 0.08 1
Immediately followed by "COM":
>> tic; [~, ~, raw] = xlsread ("Excel2013_1001x999.xlsx", 1, "", "com"); toc
Checking requested interface(s):
COM*;
Elapsed time is 4.22336 seconds.
I could not find any reference to a date/time type in the specifications. The
only available types I found are:
<simpleType name="ST_CellType">
<restriction base="xsd:string">
<enumeration value="b"/>
<enumeration value="n"/>
<enumeration value="e"/>
<enumeration value="s"/>
<enumeration value="str"/>
<enumeration value="inlineStr"/>
</restriction>
</simpleType>
Dates are stored as doubles in my tests. But I suppose it doesn't hurt to
leave the logic in if you have seen that type in some file.
In the attached file, I tried to replace any "." match with a negative match
to avoid the trouble with PCRE's MATCH_LIMIT. Additionally, I changed slightly
how the matched results are checked for consistency such that multiples of 3
errors can also be detected.
The file still performs approximately identically:
>> profile clear
>> profile on
>> tic; [~, ~, raw] = xlsread ("Excel2013_1001x999.xlsx", 1, "", "oct"); toc
combined regexps
Elapsed time is 93.4514 seconds.
>> profile off
>> profshow
# Function Attr Time (s) Time (%) Calls
---------------------------------------------------------------
54 regexp 62.862 67.55 1123
62 str2double 8.520 9.15 8
60 cat 4.825 5.18 1129
82 col2num 3.031 3.26 1999998
57 cellfun 2.868 3.08 10060
70 __OCT_xlsx2oct__ 2.762 2.97 1
77 strncmp 1.742 1.87 5
67 xls2oct 1.415 1.52 1
76 regexprep 1.192 1.28 6
47 system 1.159 1.25 1
86 strrep 1.007 1.08 5
55 cell2mat 0.689 0.74 2233
5 ischar 0.330 0.35 1000038
27 strcmp 0.108 0.12 25
75 iscellstr 0.078 0.08 6
81 clear 0.072 0.08 1
87 parsecell 0.071 0.08 1
19 cell 0.066 0.07 6
49 fread 0.063 0.07 4
2 xlsread 0.051 0.05 1
(file #41505)
_______________________________________________________
Additional Item Attachment:
File name: __OCT_xlsx2oct__.m Size:9 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?51512>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/