Skip to content

Latest commit

 

History

History
149 lines (116 loc) · 2.5 KB

1vs2.md

File metadata and controls

149 lines (116 loc) · 2.5 KB

3 Reasons to Use Jina 2.0

Easier, Faster, Powerful

2.0 is as easy as 1, 2, 3

Learning Jina 1.x was hard, in 2.0 it is as simple as 1, 2, 3.

With only three concepts - Document, Executor and Flow, with their redesigned Pythonic interface, you'll get up to speed in no time.

2.0 is faster and lighter

Compared to 1.x (1.4.2), 2.0 is

  • 3.6x faster on startup;
  • 3.4x faster on import;
  • 1.1x faster on data transmission.
Click to see benchmark

jina -v

2.0.0rc5
Benchmark #1: jina -v
  Time (mean ± σ):     392.5 ms ±   3.6 ms    [User: 278.6 ms, System: 385.4 ms]
  Range (min … max):   386.3 ms … 397.0 ms    10 runs
1.4.2
Benchmark #1: jina -v
  Time (mean ± σ):      1.419 s ±  0.251 s    [User: 1.294 s, System: 1.172 s]
  Range (min … max):    1.285 s …  2.040 s    10 runs     

python -c "from jina import Document, Flow, Executor"

2.0.0rc1
hyperfine --warmup 1 'python -c "from jina import Document, Flow, Executor"'
Benchmark #1: python -c "from jina import Document, Flow, Executor"
  Time (mean ± σ):     350.4 ms ±   6.1 ms    [User: 265.7 ms, System: 398.7 ms]
  Range (min … max):   343.2 ms … 363.2 ms    10 runs
1.4.2
Benchmark #1: python -c "from jina import Document, Flow, Executor"
  Time (mean ± σ):      1.209 s ±  0.021 s    [User: 1.085 s, System: 1.085 s]
  Range (min … max):    1.192 s …  1.248 s    10 runs

Creating a Flow

from jina import Flow
from tests import random_docs

f = Flow().add().add().add().add()

with f:
    f.index(random_docs(10000))
2.0.0rc1
✅ done in ⏱ 8 seconds 🐎 1194.1/s
1.4.2
✅ done in ⏱ 8 seconds 🐎 1127.9/s

2.0 gives You the power

Jina 1.x was a complex beast with lots of boilerplate code and not so much transparency. 2.0 embraces explicit above implicit: No more Driver! We're putting the power back in your hands. You can process Document in custom Executor directly with all the power that entails.

If you are a power user of Python, then you are a power user of Jina 2.0.