Skip to content
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

Fix regression tests on Julia 1.10 #33

Open
clarkevans opened this issue May 23, 2023 · 4 comments
Open

Fix regression tests on Julia 1.10 #33

clarkevans opened this issue May 23, 2023 · 4 comments

Comments

@clarkevans
Copy link
Collaborator

clarkevans commented May 23, 2023

There are several independent breakages on nightly.

  • #3350 breaks objects that are mutated, Custom to Custom1, Custom2, etc
  • In notation.md, it's just a change in how NamedTuple type is serialized
  • In script.md, looks like hasmethod() no longer works
@disberd
Copy link
Member

disberd commented Aug 30, 2023

This is proably related to your point 3 above, but my code relying on having custom struct interpolation inside <script> tags breaks on 1.10beta2 as it throws from this line:

throw("$(value) is not showable as text/javascript")

@clarkevans let me know if this is the same problem you mention in point 3 above or if I shall open a new issue

Maybe on 1.10 due to hasmethod becoming inferable at compile time Julia PR 48639 we don't need the @generated function anymore and can just make this a function?
EDIT: I tested a non generated function with hasmethod on 1.10 but while it's much faster than in 1.9 it is still around 40ns on my machine as opposed to the ~3ns of the @generated function here and of the ~20ns of a try-catch

@clarkevans
Copy link
Collaborator Author

Probably this is it. I could look at this later. Feel free to commit any updates.

@disberd
Copy link
Member

disberd commented Sep 5, 2023

I don't have any clear way forward here unfortunately. Putting checks with hasmethod or try -catch creates a performance penalty compared to the currently generated function or a direct call to show(io, ::MIME"text/javascript", x).
I understand the reason why the direct use of show was skipped in favor of the @generated function was to have a clearer error message. Is this correct?

I don't know how much performance critical is this code path, if going from 3ns to 20ns is OK probably the best way to keep the custom error message is to use a try-catch block, although it's not very elegant.

I remember you had extensively optimized the performance of @htl as it was crucial in some of your use case so you might now better whether this has a non-negligible impact

@fonsp
Copy link
Member

fonsp commented Oct 31, 2023

@disberd We ended up going with a poorer error message on Julia 1.10+: #36

@fonsp fonsp changed the title Fix regression tests on nightly Fix regression tests on Julia 1.10 Oct 31, 2023
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

No branches or pull requests

3 participants