Skip to content

Optimize template generator format performance #173

Closed

Description

@shps951023
No description provided.

Activity

  1. shps951023 commented on Apr 14, 2021

    @shps951023
    MemberAuthor

    Key Problem : if remove namesapcename, prefix will loss
    image

    it need cost to check prefix case like <x:xxx>
    image

  2. shps951023 commented on Apr 15, 2021

    @shps951023
    MemberAuthor

    format c innerxml is better than formating row innerxml
    image

    image

  3. shps951023 commented on May 26, 2021

    @shps951023
    MemberAuthor
    void Main()
    {
    	var value = Enumerable.Range(1, 1_000_000).Select(s => new {V=s});
    	foreach (var element in value)
    	{
    		
    	}
    
    	var st = new Stopwatch();
    	st.Start();
    	
    	
    	var path = Path.GetTempPath() + Guid.NewGuid() + ".xlsx";
    	MiniExcel.SaveAs(path,value,true);
    	
    	Console.WriteLine(st.ElapsedMilliseconds);
    	Console.WriteLine(path);
    	
    	path = Path.GetTempPath() + Guid.NewGuid() + ".xlsx";
    	
    	var templatePath = Path.GetTempPath() + Guid.NewGuid() + ".xlsx";
    	MiniExcel.SaveAs(templatePath, new[] { new {V="{{enums.V}}"}},true);
    	
    	st.Restart();
    	MiniExcel.SaveAsByTemplate(path,templatePath, new {enums=value});
    	Console.WriteLine(st.ElapsedMilliseconds);
    	Console.WriteLine(path);
    }

    image

  4. shps951023 commented on May 28, 2021

    @shps951023
    MemberAuthor
            static void Main(string[] args)
            {
                var value = Enumerable.Range(1, 1_000_00).Select(s => new { V = s });
                var path = Path.GetTempPath() + Guid.NewGuid() + ".xlsx";
                MiniExcel.SaveAsByTemplate(path, @"C:\Users\Wei\AppData\Local\Temp\52a2dca4-064f-4d6c-9d2f-3208a2f880e3.xlsx", new { enums = value });
                Console.WriteLine(path);
            }

    image
    image
    image

  5. shps951023 commented on May 28, 2021

    @shps951023
    MemberAuthor

    Memory Usage
    image
    image

  6. added
    help wanted
    on Sep 15, 2021
  7. moved this to In progress in MiniExcel projecton Jun 10, 2024
  8. michelebastione commented on Jul 12, 2026

    @michelebastione
    Collaborator

    After the changes made in the past year, especially #749 and #946, performance of the templating engine has improved substantially. There is still a lot that can be done, namely trying to remove all string interpolations and stringbuilders in favor of writing every single element using the appropriate XmlWriter's methods, but that's a huge endeavour to take as it requires almost a full rewrite of the system. Until then, I think this issue can be closed.

  9. shps951023 commented on Jul 12, 2026

    @shps951023
    MemberAuthor

    After the changes made in the past year, especially #749 and #946, performance of the templating engine has improved substantially. There is still a lot that can be done, namely trying to remove all string interpolations and stringbuilders in favor of writing every single element using the appropriate XmlWriter's methods, but that's a huge endeavour to take as it requires almost a full rewrite of the system. Until then, I think this issue can be closed.

    ❤️❤️❤️ it's huge tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions