Removed unnecessary mallocs.

The colored crate was being used for convinient coloring of the terminal
text, but after profiling I found it was responsible for almost 1/3 of
the memory allocations of the jisho searching feature.

Decided to write ANSI codes manually instead, along with using write! +
format_args! instead of format! for similar reasons, but not as
egregious.
This commit is contained in:
Hiers 2024-02-17 19:12:09 +00:00
parent a475790e63
commit 6fcd5489d5
5 changed files with 73 additions and 70 deletions

View file

@ -21,7 +21,6 @@ libc = "0.2.151"
[dependencies]
ureq = { version = "2.8.0", features = ["json"] }
serde_json = "1.0.108"
colored = "2.1.0"
argparse = "0.2.2"
atty = "0.2.14"
kradical_parsing = "0.1.0"