Skip to content

Conversation

@jverzani
Copy link
Contributor

This leverages #286 to make a few lookups more performant:

  • in lambdify we need the julia symbol for an operation
  • in the TermInterface extension we need the julia operation for a symbolic expression

Rather than use get_symengine_class we can save a few allocations by using get_type to index into a pre-allocated vector.

As well, when comparing the symbols to the julia symbols, it was clear a few operations of SymEngine were in need of Julia counterparts.




const julia_operations = Vector{Any}(missing, length(SymEngine.symengine_classes))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is const and gets changed afterwards?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Julia, the binding is constant, but not its components. (To be honest, I'm not sure this gives any performance improvement here.)

@jverzani jverzani merged commit d4f4c53 into symengine:master Mar 19, 2025
8 of 9 checks passed
@jverzani jverzani deleted the julia_operation branch March 19, 2025 18:48
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.

2 participants