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 in JNumber number conversions #37

Open
mdedetrich opened this issue Jul 11, 2017 · 5 comments
Open

Add in JNumber number conversions #37

mdedetrich opened this issue Jul 11, 2017 · 5 comments

Comments

@mdedetrich
Copy link
Owner

In response to #17 (comment), we should add JNumber converters to various number formats (since its likely most users will get this wrong)

mdedetrich added a commit that referenced this issue Jul 11, 2017
There is now a constructedFlag which tracks how a JNumber is created
mdedetrich added a commit that referenced this issue Jul 11, 2017
mdedetrich added a commit that referenced this issue Jul 11, 2017
@axel22
Copy link

axel22 commented Jul 19, 2017

+1

@mdedetrich
Copy link
Owner Author

@axel22 What are your opinions of this PR #38?

@axel22
Copy link

axel22 commented Jul 19, 2017

I like it, would be good to have that! About the ScalaMeter tests, it's possible that you would get a better accuracy by adding a loop inside the benchmarked snippet (to increase the number of iterations).

About the @inline annotations on constants, if you use defs everywhere, it's almost certain that the JIT compiler will inline all invocations to them.

@mdedetrich
Copy link
Owner Author

I like it, would be good to have that! About the ScalaMeter tests, it's possible that you would get a better accuracy by adding a loop inside the benchmarked snippet (to increase the number of iterations).

Thanks, I will add more benchmarks + add this inner loop

About the @inline annotations on constants, if you use defs everywhere, it's almost certain that the JIT compiler will inline all invocations to them.

Try, I use @inline for 2 reasons

  • This is a cross platform library (so it will target scala-native and it currently targets Scala.js). So I wan't really make sure that it inlines (although I am fairly sure that these projects should inline such code)
  • It shows the intent of what is meant to happen, i.e. they really are constants

@axel22
Copy link

axel22 commented Jul 20, 2017

Makes sense!

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

2 participants