-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize and simplify haskell-ds-create-imenu-index
with hashtable
#1857
Conversation
Just in case: CC: @cocreature as the last person who touched the function |
Thanks for this. I approved the CI and it's complaining about part of the change, not immediately obvious to me why. :) |
Hmm, bizarre indeed… The snippet Okay, thank you, I'll look at it later |
It's a warning that is promoted to an error, but the cause is |
b95296a
to
89c6f2d
Compare
Oh, thank you! I was comparing the I added the line, let's see if CI will be okay with it |
Welp… 😊 I'll dig into it later, don't bother for now, thank you! |
Yeah, I don't really like that pattern of importing, partly for this reason! The error with Emacs 25.1 is because |
Well, |
Huh! 🤔 |
Oh, actually, scratch that. I just looked at the job log, and apparently the purescript-mode CI, for some reason, doesn't compile that specific file at all. It compiles other files, but not this one. So most likely this is the reason I don't see the failure there. |
The function has implemented a poor man's hash table by manually enlisting keys and then using `cl-case` on values. Just replace this with a hashtable and thus simplify the code considerably. This makes it faster as well because the `cl-case + setq` is O(n) whereas `puthash` is O(1). The output of the function was tested on Pandoc's `Writers/Powerpoint/Output.hs` file of 2841 lines and comparing the hashsum of the output before the changes and after. It didn't change. The commit is also basically a backport of a similar change on purescript-mode that has been forked form haskell-mode at some point: purescript-emacs/purescript-mode#27
89c6f2d
to
a4e246e
Compare
Okay, in this case, another attempt… I changed The reason I attempted |
Yeah, always tricky juggling these things when aiming for compatibility with a wide range of Emacsen. It's possible that the Merging now, thanks! |
The function has implemented a poor man's hash table by manually enlisting keys and then using
cl-case
on values. Just replace this with a hashtable and thus simplify the code considerably. This makes it faster as well because thecl-case + setq
is O(n) whereasputhash
is O(1).The output of the function was tested on Pandoc's
Writers/Powerpoint/Output.hs
file of 2841 lines and comparing the hashsum of the output before the changes and after. It didn't change.The commit is also basically a backport of a similar change on purescript-mode that has been forked form haskell-mode at some point: purescript-emacs/purescript-mode#27