transit-lang-cmp
jsoniter-scala
Our great sponsors
transit-lang-cmp | jsoniter-scala | |
---|---|---|
15 | 29 | |
421 | 706 | |
- | - | |
0.0 | 9.6 | |
5 months ago | 5 days ago | |
Elixir | Scala | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
transit-lang-cmp
-
Migrating from Warp to Axum
> The axum::debug_handler macro is invaluable to debug type errors (there's some with axum too), like for example, accidentally having a non-Send type slip in.
Heh, yeah. For my recent project where I explored implementing the same little app in a few different languages[0], I chose Axum for the rust version.
The whole "extractor" system was pretty magical, and when I had this exact issue (non-Send argument), the compiler error was totally useless. I did see the docs about adding this extra macro crate for error messages but it seemed like a bit of a red flag that the framework was going against the grain of the language. Still, on the whole, I did enjoy working with Axum.
[0] https://github.com/losvedir/transit-lang-cmp
- Transit: A Code Comparison
-
Programming language comparison by reimplementing the same transit data app
This is great! Just pushed up a commit that uses it and updated the benchmarks[0]. I'm seeing a 1.6X - 2X improvement in overall performance. Not bad for a drop-in replacement. And since it's based on serde, I trust it, and I feel like trying out a different JSON library is within scope for me of not just "gaming the benchmarks", as this is actually something I'd now consider using at work.
It's not quite as high as I was seeing with `jiffy` (3,800 req/sec here vs 4,000+ with jiffy), but I'm not confident that was a totally fair comparison. `jiffy` doesn't integrate as nicely with Phoenix, so I was just calling `:jiffy.encode(...)` in the controller and then doing a `text(...)` response. I need to double-check if `json(...)` is doing more work here.
[0] https://github.com/losvedir/transit-lang-cmp/commit/140d693b...
-
Why does Scala seem to be slow at benchmark results?
Nowadays, I reached out for some benchmark results. Scala is slower than Java and Kotlin. Can you explain it? https://github.com/losvedir/transit-lang-cmp https://github.com/kostya/benchmarks
-
Why is C#/dotnet outperforming rust in my simple benchmarks?
I had a chance to update the Go code (commit) to pre-allocate the arrays based on the known length before all the appends, and saw ~30% increase in performance, with top requests per second going from about 8,600 to 11,000.
-
The RedMonk Programming Language Rankings: June 2022
I recently did a little project to compare several languages (https://github.com/losvedir/transit-lang-cmp) so I contributed to a bunch of those points!
- Show HN: An informal comparison of several programming languages
jsoniter-scala
-
1BRC Merykitty's Magic SWAR: 8 Lines of Code Explained in 3k Words
What an amazing step by step explanation!
More than 2 years ago I found that byte array view var handles are quite suitable to cook efficient SWAR routines with Java/Scala.
See a lot of other examples of SWAR usage, like parsing Base16/64 string, java.time.* and number values directly from byte arrays:
https://github.com/plokhotnyuk/jsoniter-scala/blob/master/js...
-
The Newest Java Json Benchmark Results just dropped
Afaik dsl-json came up with a lot of improvements and inspired a several other libraries like JsonIter and jsonIter-scala. Jsoniter-scala by u/plokhotnyuk is probably the most optimized JSON library on the JVM at this point, and seems to power most of the Scala ecosystem. Some implementations/optimizations eventually made their way back into Jackson and other libraries.
-
Please try my JSON library
I was on your place more then 5 years ago, when cut the 1st release of jsoniter-scala.
-
Post your problems with Scala 3/2.13 compiler performance!
I've just increased compiler performance in ~1.5x times by adding these JVM options for the code cache
-
smithy-translate : a CLI tool to turn openapi specs and json-schema specs into smithy specs, written in Scala
We have our own open-source code-generator that produces Scala code from Smithy. The code module is entirely dependency-free, and the generated code is not biased towards any library, be that http or json. We do however have out-of-the-box integration with jsoniter and http4s.
-
Why does Scala seem to be slow at benchmark results?
You can use jsoniter-scala. It is easy to use like upickle.
-
Scala needs *highly* efficient libraries to survive in a multi-core age
BTW, jsoniter-scala uses it for faster parsing and serialization using SWAR techniques, like here.
-
Using Circe with GADT
Probably you should have both codecs (for Foo and for its T) are implicitly available in the scope, like it is done in the following test for jsoniter-scala:
-
Starting with scala
BEWARE: uJson is vulnerable under DoS attacks
-
Is Scala a good choice for a data intensive web backend?
Please see sources (and GitHub history of development) of jsoniter-scala as an example in the domain of JSON parsing and serialization.
What are some alternatives?
scotty - Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp (Official Repository)
circe - Yet another JSON library for Scala
tapir - Declarative, type-safe web endpoints library
json4s - JSON library
plainchant - plainchant - a lightweight and libre imageboard
DSL-JSON - High performance JVM JSON library
template_rust_web_api
jackson-module-scala - Add-on module for Jackson (https://github.com/FasterXML/jackson) to support Scala-specific datatypes
hashbrown - Rust port of Google's SwissTable hash map
Play JSON - The Play JSON library
deno_std - deno standard modules
spray-json - A lightweight, clean and simple JSON implementation in Scala