Skip to content

Conversation

Wuestengecko
Copy link
Member

@Wuestengecko Wuestengecko commented Jun 30, 2025

This could prove to be a viable alternative to #217. Initial experimentation has shown promising results with almost 50% reduction in memory use when using a specialized, custom parser built on top of quick-xml even in a still relatively naive implementation, where the main idea is to deduplicate tag and attribute names in memory (using a temporary HashMap to store Arc<(Option<String>, String)> over directly using the parsed-out (Option<String>, String) on the Rust side, but the same should hold true for the Python equivalents) — and there's probably still a lot of room for further optimizations.

This might still prove to be completely non-viable depending on the actual feature set that we'd have to reimplement, but so far the only bigger issues I've found are a few simple XPaths (which should be straight-forward to implement without an XPath engine) and the MelodyModel.find_references() function, which delegates to C code via an XPath query in order to actually become usable in terms of performance (if I'm not mistaken, runtime went down by at least 2-3 orders of magnitude).

@Wuestengecko Wuestengecko force-pushed the alternative-backend branch from 760643f to fa4f0e1 Compare July 1, 2025 15:15
@Wuestengecko Wuestengecko force-pushed the alternative-backend branch 7 times, most recently from ae20d82 to 3d87153 Compare July 15, 2025 17:20
@Wuestengecko Wuestengecko force-pushed the alternative-backend branch 5 times, most recently from 4f1d591 to cd7fa65 Compare July 23, 2025 12:18
@Wuestengecko Wuestengecko force-pushed the alternative-backend branch 5 times, most recently from 88332d7 to 8c01a3a Compare August 5, 2025 11:53
@Wuestengecko Wuestengecko force-pushed the alternative-backend branch 3 times, most recently from 077b3bd to 0d89c5a Compare August 13, 2025 12:30
@Wuestengecko Wuestengecko force-pushed the alternative-backend branch 4 times, most recently from 4e39e47 to 3e812d8 Compare August 26, 2025 12:19
@Wuestengecko Wuestengecko force-pushed the alternative-backend branch 3 times, most recently from 90783c5 to a3c7089 Compare August 28, 2025 12:54
@Wuestengecko Wuestengecko force-pushed the alternative-backend branch 2 times, most recently from 589105d to b666fdc Compare September 9, 2025 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant