forked from norcalli/nvim-colorizer.lua
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Perf: Trie implementation is space efficient (#131)
* ref(utils): renames byte_is_valid_colorchar to byte_is_valid_color_char * test: adds test cases for nonalphanumeric custom_names including spaces * fix(util): do not add spaces as an additional color character for checking valid color chars * chore: adds error message if trie returns length but not rgb_hex * doc: updates readme and ldoc * ref(trie): dynamically build char_lookup based on inserted words, removes need for adding additional characters manually * ref(tailwind_names): tailwind names uses same trie as names * fix: removes reference to tailwind_names module * feat: Trie dynamically allocates memory for each node and resizes capacity when needed. Starts with an initial capacity of 8 * chore: removes old ldoc html file * doc: let ldoc decide which markdown parser to use * test: creates start_minimal-trie.sh script to run trie tests * test: creates makefile for executing testing targets * chore: creates trie benchmarks for different initial capacity settings
- Loading branch information
Showing
46 changed files
with
945 additions
and
867 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Define variables for script paths | ||
SCRIPTS_DIR=scripts | ||
TRIE_TEST_SCRIPT=$(SCRIPTS_DIR)/trie-test.sh | ||
TRIE_BENCHMARK_SCRIPT=$(SCRIPTS_DIR)/trie-benchmark.sh | ||
MINIMAL_SCRIPT=$(SCRIPTS_DIR)/minimal-colorizer.sh | ||
|
||
help: | ||
@echo "Available targets:" | ||
@echo " make trie - Run trie test and benchmark" | ||
@echo " make trie-test - Run trie test" | ||
@echo " make trie-benchmark - Run trie benchmark" | ||
@echo " make minimal - Run the minimal script" | ||
@echo " make clean - Remove test/colorizer_*" | ||
|
||
trie: trie-test trie-benchmark | ||
|
||
trie-test: | ||
@echo "Running trie test..." | ||
@bash $(TRIE_TEST_SCRIPT) | ||
|
||
trie-benchmark: | ||
@echo "Running trie benchmark..." | ||
@bash $(TRIE_BENCHMARK_SCRIPT) | ||
|
||
minimal: | ||
@echo "Running minimal config..." | ||
@bash $(MINIMAL_SCRIPT) | ||
|
||
clean: | ||
@echo "Removing test/colorizer_repro" | ||
@rm -rf test/colorizer_repro | ||
@echo "Removing test/trie/colorizer_trie" | ||
@rm -rf test/trie/colorizer_trie | ||
|
||
.PHONY: help trie trie-test trie-benchmark minimal clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.