This time the StringTempletReplet.dll component has updated some algorithms. It mainly relies more on the values in static variables in memory.
This was done without changing the template. Cache templates, cache delegates, and cache tag parsing data. But this will consume more memory.
In order to dynamically change the template, the time of the file must be detected each time. Spent a lot of time on this. Perhaps in the future, the function of dynamically changing templates should be removed, and only an interface that notifies the template class of which template file to re-read should be provided.
Canceled this page (RetuenString.aspx - accepts the tag string and returns the parsing result)
After all, tags don't make a scripting language. This function makes no sense.
Some people say they don’t know how to use this template class. Let’s briefly talk about it here:
The main function of the template class is not to read the whole page template. Mainly to read the page fragment template. Just read the fragments, parse and display them.
In web2.0 sites, such as blog development. Page for user-defined skins. In other words, the full static page plays a big role in the update of the news system.
The functionality of tags is extended through tag parsing functions. Therefore, the speed of the template class is not only the execution speed of the StringTempletReplet.dll component itself. Also add the execution time of the tag parsing function. The tag parsing function provided in my example just returns a simple string.
Just to name it for convenience. All the template class does is provide a stage. And try to make the template class execution time faster. As for whether the tag parsing function is always executed. How much time does it take. That's a matter of using people.
Regular replacement template class has also been written. But I tested it myself and performed tag positioning analysis on a string with a length of more than 2 million. It is more than 8 times slower than pointer positioning. When the length of the template string continues to decrease. Maybe the gap will narrow over time. But even if the two label positioning times are the same. According to the immutability of strings, continuous replacement of a string will produce a new string. It consumes too many resources.
Business.cs can be placed in the UI layer or the logic layer. Just inherit the FunctionList class. To inherit this class, just override the static constructor. Establish the correspondence between the label and the label execution function in the static constructor.
In fact, an execution label was written in the previous version. Just add the "execution_" mark before the label name
{$execution_labelname:parameter1:parameter2:parameter3::character10$}
This eliminates the need to override the static constructor. It is performed through reflection. But the speed is very slow. It was later cancelled. After all, speed is critical for template classes.
I don't have a fixed location for everyone to download. In the past, the compressed files were used as gif images. Pass it to your NetEase profile. But later NetEase inspected the pictures. Make it impossible for everyone to stop. I'm looking for a new location. The image location will vary.
now is