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

Vector map variant #19

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Vector map variant #19

wants to merge 13 commits into from

Conversation

mdedetrich
Copy link
Owner

Change data structure of safe JObject from Map to a custom VectorMap implementation which preserves key ordering on insertion of elements

Still to do

  • Specializations for 1 .. 6n length VectorMap (same as Map implementation)
  • Benchmarks
  • Override more methods for performance (i.e. builders)

@codecov-io
Copy link

codecov-io commented Jun 30, 2017

Codecov Report

Merging #19 into master will decrease coverage by 2.18%.
The diff coverage is 23.68%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #19      +/-   ##
=========================================
- Coverage   44.68%   42.5%   -2.19%     
=========================================
  Files           5       6       +1     
  Lines         687     760      +73     
  Branches      133     140       +7     
=========================================
+ Hits          307     323      +16     
- Misses        380     437      +57
Impacted Files Coverage Δ
jvm/src/main/scala/scalajson/ast/JValue.scala 71.17% <ø> (-2.23%) ⬇️
...s/src/main/scala/scalajson/ast/unsafe/JValue.scala 0% <0%> (ø) ⬆️
js/src/main/scala/scalajson/ast/JValue.scala 0% <0%> (ø) ⬆️
...n/scala/scala/collection/immutable/VectorMap.scala 25.37% <25.37%> (ø)
...m/src/main/scala/scalajson/ast/unsafe/JValue.scala 59.5% <50%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fd5637b...c06e9e0. Read the comment docs.

@mdedetrich mdedetrich mentioned this pull request Jul 1, 2017
# Conflicts:
#	js/src/main/scala/scalajson/ast/JValue.scala
#	jvm/src/main/scala/scalajson/ast/JValue.scala
Copy link

@gmethvin gmethvin left a comment

Choose a reason for hiding this comment

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

I think we need some tests for VectorMap itself.

Hopefully @SethTisue or someone else from the scala team can clarify, but is it appropriate to use the scala.collection package here?

Maybe we should keep the VectorMap class private for now and only use the Map or immutable.Map type in the public API.

@@ -0,0 +1,169 @@
package scala.collection.immutable
Copy link
Contributor

Choose a reason for hiding this comment

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

I would like to echo @gmethvin's concern here. I don't think we should use package scala here.

/cc @SethTisue

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry I missed this before. while it's certainly possible this could eventually become part of the Scala 2.13 collections, for now it's not okay to use scala.collection

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.

5 participants