Xah Talk Show 2023-01-07 Emacs Lisp, WolframLang, Speed Comparison for Find/Replace
done livestream. whopping 2.5 hours. but good! this i wanted to do since few months ago.
today, we did speed comparison of elisp and wolfram lang.
all code written from scratch.
so if u wanna see how its done, watch it.
but the 2.5 hours, partly due to some setup the context, a bit chatting on other things, and some 20 min debug of a silly path error in WL.
overall, we got some results.
the gist of this livestream, is to prove my haunch, that when doing find/replace, with lots pairs of strings, elisp speed will beat all other langs. due to, elisp buffer datatype (aka rope or similar).
though, am not sure. because, in golang, once u turn the giant buffer content to slice of runes (aka smart array of chars), elisp buffer datatype may not have advantage.
also, in wolfram lang, since it's simply a just 2 function calls, WL has efficient internal algorithm for the actual find/replace, so there, elisp maybe not faster neither.
but for python, js, i think elisp may be faster. cuz there, python and js, their strings are immutable. each change means recreating whole string. unless u code them by using array of chars. in js, that'd be using the specialized array buffer object. in python, something similar. Would be a bit involved.