douglasg14b / BetterConsoleTables

Faster, colorable, more configurable, and more robust console colors & tables for C# console applications
GNU Lesser General Public License v3.0
92 stars 16 forks source link

Version 2 (Colors, New API, and More) #12

Closed douglasg14b closed 3 years ago

douglasg14b commented 5 years ago

Goals/Scope:

Out of Scope:

This will mostly require a rewrite of much of the Table's working so I can bake in interoperability and compatibility while minimizing code reuse.

Misc Thoughts:

Extracting table through reflection:

Bugs

douglasg14b commented 5 years ago

Track changes on the https://github.com/douglasg14b/BetterConsoleTables/tree/Version2 branch

douglasg14b commented 5 years ago

Making the actual configuration of each cell, row, or column user friendly is quite the pain... It would be unreasonable to expect the caller to pass in a complex configuration with each value.

douglasg14b commented 4 years ago

image

Progress!

douglasg14b commented 4 years ago

More Progress, working through making the configuration easier as it's a bit of a chore right now, while keeping performance in mind.

Right now cell formatting is controlled via the headers. Meaning the formatting granularity is per column, header vs rows. Individual cells cannot be controlled yet, however, it sets the formatting for each individual cell right now.

image

The format setting needs to determine when it should and should not use the CellFormat object, and avoid creating duplicate objects, for the sake of high performance.

To Do (Performance):

douglasg14b commented 4 years ago

Version 2 is stable and should be ready for a beta release. A nice fluent API has been developed as well.

This also comes with a console colors/formatting library that performs the same functions as other libraries like crayon but MUCH more efficiently (ie. it isn't a cluster of regex). I created this from scratch because I didn't want unnecessary dependencies, and needed control over the performance characteristics.

douglasg14b commented 4 years ago

Currently v2 will NOT have the performance of v1 when it comes to table creation, though it should still be close. Tables can now have their data replaced, instead of creating a brand new Table object every time you need to print. This reduces the CPU overhead of creating a new table, and a new formatting matrix. Though this comes at the cost of memory utilization (marginally).

Performance actually appears to be better: 0.015 ms.

Though this could be due to having a more controlled performance testing environment, and different hardware.

douglasg14b commented 4 years ago

2.0.0-beta1 Nuget Package

2.0 is now in beta as a nuget package. Along with the Core library and the Colors library.

Relicencing to LGPL-3

2.0 relicences from MIT to LGPL-3, this will not affect anyone using this as a library and puts an extra restriction on unfettered copy/pasting of my code to other projects. I put a lot of effort into this, and it would be a shame for it to be for naught if it was just copy/pasted into a more popular project.