Performance vs Features: A Discussion About Sai's Future Direction #25
Replies: 3 comments 3 replies
-
@aaronmallen For the opt-in option, could it just be an added DSL method? Like: Sai.red.on_blue.bold.sequenced.decorate('Hello') |
Beta Was this translation helpful? Give feedback.
-
Does this matter in use? It's nice to make things fast, but if this is more of a theoretical problem, I'd leave it in favor of keeping whatever benefits it's providing. If this can't be improved and it is a problem in practice, @jaredcwhite's idea sounds like a smart compromise. Could it be both? If you do the opt-in you get things exactly as they are, but if you opt-out you get the additional DSL method incase you need it for a special case? Maybe make it opt-out instead of opt-in? |
Beta Was this translation helpful? Give feedback.
-
My vote goes for a great developer experience by default that can be opted out of for performance considerations. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, Aaron here!
I've been working on a significant performance refactor over the last few weeks and have achieved some excellent improvements in Sai, with some operations showing 50%+ performance gains compared to previous versions. However, when comparing Sai to other CLI color gems, we face an interesting tradeoff that I'd like the community's input on.
The Current Situation
One of Sai's distinctive features is its
SequencedString
object, returned when you calldecorate
. This object provides powerful manipulation capabilities:It also enables detailed string segment analysis:
The Challenge
While these features are powerful, the parsing required for
SequencedString
is computationally expensive. Our benchmarks show that:SequencedString
as the default: Sai places last in both IPS and Memory benchmarksSequencedString
: Sai consistently places second across all benchmarksThe Decision
We have two potential paths forward:
SequencedString
as the default, embracing our unique feature set despite lower benchmark performanceSequencedString
opt-in through a breaking change, where string sequencing would work like this:I'd love to hear the community's thoughts on this tradeoff between default features and performance.
8 votes ·
Beta Was this translation helpful? Give feedback.
All reactions