• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lloydmeta / enumeratum / 745
89%

Build:
DEFAULT BRANCH: master
Ran 06 Feb 2017 05:09PM UTC
Jobs 1
Files 44
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
745

push

travis-ci

web-flow
Enum Set and Map comparisons

- Add comparisons for Java EnumSet and Scala Set (#114)
- Add Map comparisons

Results
-------

[info] Benchmark                                  Mode  Cnt   Score   Error  Units
[info] MapComparisons.enumeratumScalaMapGet       avgt   30   9.830 ± 0.207  ns/op
[info] MapComparisons.jEnumEnumMapGet             avgt   30   4.745 ± 0.685  ns/op
[info] MapComparisons.jEnumScalaMapGet            avgt   30  12.204 ± 0.186  ns/op
[info] SetComparisons.enumeratumScalaSetContains  avgt   30   7.670 ± 1.333  ns/op
[info] SetComparisons.jEnumEnumSetContains        avgt   30   4.391 ± 0.077  ns/op
[info] SetComparisons.jEnumScalaSetContains       avgt   30   8.906 ± 0.235  ns/op

Discussion
----------

There is no denying that Java  EnumMap and EnumSet are fast. Given that JMH supposedly has
an over head of 2-3ns, they both offer roughly 2-3ns/op, which might just be noise !

On the other hand, plain old Scala Set and Map aren't bad either, coming in at < 10ns/op,
which is maybe 4-6ns/op accounting for overhead and noise. They don't do as well with Java Enums though; maybe this is because case objects have nicer hashCode implementations? Not sure.

So the current state of things is that Java EnumMap and EnumSet are roughly 2x faster than
plain old Scala Set and Maps w/ Enumeratum, but being that we're still in the sub-10ns
range, it seems reasonable to say that performance here won't be a bottleneck except in super
edge cases.

402 of 402 relevant lines covered (100.0%)

1.0 hits per line

Jobs
ID Job ID Ran Files Coverage
2 745.2 06 Feb 2017 05:09PM UTC 0
100.0
Travis Job 745.2
Source Files on build 745
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #745
  • 3756b8b4 on github
  • Prev Build on master (#742)
  • Next Build on master (#750)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc