Hi guys, I have to read a huge xml file, which consists of more than 3 million entries and more than 10 million nested elements.
Naturally, I use xmltextreader and got my syntax time up to about 40 seconds from the earlier 90 seconds, using a few tricks and optimization tips.
but I want to keep processing time as much as possible below the question
quite a few elements are of type xs: boolean, and the data provider always represents values ββas true or false β never β1β or β0β
for such cases my earliest code is:
if (xmlTextReader.Value == "true")
{
bool subtitled = true;
}
which is further optimized for:
if (string.Equals(xmlTextReader.Value, "true", StringComparison.OrdinalIgnoreCase))
{
bool subtitled = true;
}
, ( "", "" )?
if (xtr.value.length == 4)
{
bool subtitled = true;
}