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

Add performance tip #2532

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Add performance tip #2532

merged 1 commit into from
Oct 10, 2023

Conversation

jilen
Copy link
Collaborator

@jilen jilen commented Jul 11, 2022

Add a compiler performance tip.

@jilen jilen force-pushed the compiler_performance_tip branch 3 times, most recently from a431190 to 718019a Compare July 11, 2022 03:37
@deusaquilus
Copy link
Collaborator

deusaquilus commented Jul 11, 2022

Nice catch @jilen! This is very, very useful!
If you don't mind I'd like to polish the grammar a little bit before committing.

@jilen
Copy link
Collaborator Author

jilen commented Jul 11, 2022

@deusaquilus Yes, my English is poor, it would be great if you can improve the description.

@guizmaii
Copy link
Member

guizmaii commented Aug 17, 2023

@deusaquilus @jilen I feel like this is a pain for many Quill users and so I'd like to merge this PR.

Can we merge it as is? @deusaquilus Can you bring the precision you wanted to bring maybe, please?

Also, since 2.13.11, implicit must have explicit type declaration, which seems to go against this trick. How do we solve this issue?

Edit:
Found the answer to my last question here: scala/bug#12798 (comment)
Basically we need to wait for Scala 2.13.12 so that we can @nowarn the scalac fatal warnings that will be emitted for these implicit instances

@guizmaii
Copy link
Member

@jilen Now that Scala 2.13.12 is out, could you please update your PR to explain how to make this trick work with the new version of Scala, please?

@mkemaldurmus
Copy link

@jilen any update on this pr ?

@jilen jilen force-pushed the compiler_performance_tip branch 2 times, most recently from 1cd0679 to b626c70 Compare September 27, 2023 07:43
@guizmaii
Copy link
Member

@jilen Is this ready to be merged?

@guizmaii
Copy link
Member

@jilen The CI passes. Is your PR ready?
if possible I'd like to merge it before making a new release and I need to make a new release soon as the v4.7.0 didn't publish some modules for the Scala 2.13 version (which I fixed today here: #2877)

@jilen jilen force-pushed the compiler_performance_tip branch 5 times, most recently from 5bb0d5e to 9514d21 Compare October 8, 2023 12:32
@jilen
Copy link
Collaborator Author

jilen commented Oct 10, 2023

@guizmaii The doc is rewritten. I think we can merge it first if no obvious errors.

val ctx = SqlMirrorContext(MirrorIdiom, Literal)

// Prevent using default macro generated query meta instance.
import ctx.{ materializeQueryMeta => _, _ }
Copy link
Member

@guizmaii guizmaii Oct 10, 2023

Choose a reason for hiding this comment

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

Can we use the Scala3 syntax maybe? Or at least show it also? People are probably using the -Xsource:3 flag even if they still use Scala2
Is it:

import ctx.{ materializeQueryMeta => *, * }

?

@guizmaii
Copy link
Member

@jilen Thanks for this! I just left one comment. Let me know what you think 🙂

@jilen jilen merged commit 800a540 into master Oct 10, 2023
13 checks passed
@jilen jilen deleted the compiler_performance_tip branch October 10, 2023 09:32
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.

4 participants