Skip to content

Commit

Permalink
fix actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tellnobody1 committed Mar 5, 2024
1 parent b6e7630 commit 95ff0f0
Show file tree
Hide file tree
Showing 14 changed files with 2,828 additions and 1,295 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
name: test

on:
push:
branches:
- main
pull_request:
branches:
- main
push

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v4.1.1
with:
clean: false
fetch-depth: 0 # with tags
submodules: 'recursive'
- uses: actions/setup-java@v1.4.3
- uses: actions/setup-java@v4.1.0
with:
java-version: 17
java-version: 21
distribution: 'zulu'
- uses: actions/setup-node@v4.0.2
working-directory: ./purs/test
with:
cache: 'npm'
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sbt +test
- uses: actions/setup-node@v2.1.5
- run: |
cd purs/test
npm i
bin/tes
- name: npm i
run: npm i
working-directory: ./purs/test
- name: spago build
run: npx spago build
working-directory: ./purs/test
- name: spago test
run: npx spago test
working-directory: ./purs/test
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
**/target/
*.swp
.DS_Store
/.bsp/
**/.bloop
.metals
**/metals.sbt
.vscode
target/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019–2022 zero-deps
Copyright (c) 2019–2024 zero-deps

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
42 changes: 38 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# proto

[![Scaladex](https://index.scala-lang.org/zero-deps/proto/proto/latest-by-scala-version.svg)](https://index.scala-lang.org/zero-deps/proto/proto)
[![CI](https://img.shields.io/github/workflow/status/zero-deps/proto/test?label=tests)](https://github.com/zero-deps/proto/actions/workflows/test.yml)
[![License](https://img.shields.io/github/license/zero-deps/proto)](LICENSE)
[![LoC](https://img.shields.io/tokei/lines/github/zero-deps/proto)](#)

Lightweight and fast serialization library for Scala 2/3 based on Protocol Buffers with macros magic.

Expand All @@ -30,7 +27,7 @@ libraryDependencies += "io.github.zero-deps" %% "proto" % "latest.integration"

Dependency as a git-submodule is also supported.

## Benchmark
## Benchmark #1

data | | library | scala-2 | scala-3
---- | ------ |:-------------- | -------------: | ------------:
Expand Down Expand Up @@ -77,6 +74,43 @@ project bench
jmh:run -i 2 -wi 1 -f1 -t1
```

## Benchmark #2

data | | library | scala-3
---- | ------ |:-------------- | -------------:
data | decode | java | ` 92130,460`
data | decode | jackson | ` 517036,354`
data | decode | proto | ` 6716619,956`

data | | library | scala-3
---- | ------ |:-------------- | -------------:
data | encode | java | ` 537462,511`
data | encode | jackson | ` 882065,311`
data | encode | proto | ` 9380874,587`

data | | library | scala-3
---- | ------ |:-------------- | -------------:
msg | decode | proto | `11733555,275`

data | | library | scala-3
---- | ------ |:-------------- | -------------:
msg | encode | proto | `18486833,582`

### environment

Apple M1\
16 GB\
Java 21

### run benchmark

```bash
sbt
project bench
++ 3.0.0
jmh:run -i 2 -wi 1 -f1 -t1
```

## Usage

You can pick one of the way how to define field number:
Expand Down
12 changes: 5 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ val `proto-parent` = project.in(file(".")).settings(
, version := zero.git.version()
).aggregate(proto, protosyntax, protopurs, prototex, protoops, bench)

ThisBuild / scalaVersion := "3.3.1"
ThisBuild / crossScalaVersions := "3.3.1" :: "2.13.12" :: "2.12.18" :: Nil
ThisBuild / scalaVersion := "3.3.3"
ThisBuild / crossScalaVersions := "3.3.3" :: "2.13.13" :: "2.12.19" :: Nil

lazy val proto = project.in(file("proto")).settings(
name := "proto",
Expand Down Expand Up @@ -47,9 +47,9 @@ lazy val bench = project.in(file("bench")).settings(
, libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => Seq(
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % "2.6.4",
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % "2.6.4" % "compile-internal",
"io.suzaku" %% "boopickle" % "1.3.3",
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % "2.28.3",
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % "2.28.3" % "compile-internal",
"io.suzaku" %% "boopickle" % "1.4.0",
)
case _ => Nil
}
Expand Down Expand Up @@ -89,8 +89,6 @@ ThisBuild / scalacOptions ++= {
}
}

ThisBuild / resolvers += Resolver.JCenterRepository

turbo := true
useCoursier := true
Global / onChangedBuildSource := ReloadOnSourceChanges
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.9
sbt.version=1.9.9
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
addSbtPlugin("io.github.zero-deps" % "sbt-git" % "2.5.3.gd2541c1")

/* benchmark */
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.2")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")
// addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.4")
// libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.3"
/* benchmark */
Expand Down
11 changes: 0 additions & 11 deletions purs/src/main/scala-3.0/io.scala

This file was deleted.

Loading

0 comments on commit 95ff0f0

Please sign in to comment.