turbopipe 1.0.3__tar.gz → 1.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of turbopipe might be problematic. Click here for more details.

@@ -32,7 +32,7 @@ jobs:
32
32
  runs-on: ${{matrix.os}}
33
33
  strategy:
34
34
  matrix:
35
- os: [ubuntu-latest, windows-latest, macos-13, macos-14]
35
+ os: [ubuntu-latest, windows-latest, macos-14]
36
36
 
37
37
  env:
38
38
  CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: turbopipe
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Summary: 🌀 Faster ModernGL Buffer inter process data transfers
5
5
  Home-page: https://brokensrc.dev
6
6
  Author-Email: Tremeschin <29046864+Tremeschin@users.noreply.github.com>
@@ -77,7 +77,7 @@ rye add turbopipe
77
77
 
78
78
  # 🚀 Usage
79
79
 
80
- See also the [**Examples**](examples) folder for more controlled usage, and [**ShaderFlow**](https://github.com/BrokenSource/ShaderFlow/blob/main/ShaderFlow/Scene.py) usage of it!
80
+ See also the [**Examples**](https://github.com/BrokenSource/TurboPipe/tree/main/examples) folder for more controlled usage, and [**ShaderFlow**](https://github.com/BrokenSource/ShaderFlow/blob/main/ShaderFlow/Scene.py) usage of it!
81
81
 
82
82
  ```python
83
83
  import subprocess
@@ -122,7 +122,7 @@ ffmpeg.wait()
122
122
  > - 🚀: Threaded `ffmpeg.stdin.write(buffer.read())` with a queue (similar to turbopipe)
123
123
  > - 🌀: The magic of `turbopipe.pipe(buffer, ffmpeg.stdin.fileno())`
124
124
  >
125
- > Also see [`benchmark.py`](examples/benchmark.py) for the implementation
125
+ > Also see [`benchmark.py`](https://github.com/BrokenSource/TurboPipe/blob/main/examples/benchmark.py) for the implementation
126
126
 
127
127
  ✅ Check out benchmarks in a couple of systems below:
128
128
 
@@ -42,7 +42,7 @@ rye add turbopipe
42
42
 
43
43
  # 🚀 Usage
44
44
 
45
- See also the [**Examples**](examples) folder for more controlled usage, and [**ShaderFlow**](https://github.com/BrokenSource/ShaderFlow/blob/main/ShaderFlow/Scene.py) usage of it!
45
+ See also the [**Examples**](https://github.com/BrokenSource/TurboPipe/tree/main/examples) folder for more controlled usage, and [**ShaderFlow**](https://github.com/BrokenSource/ShaderFlow/blob/main/ShaderFlow/Scene.py) usage of it!
46
46
 
47
47
  ```python
48
48
  import subprocess
@@ -87,7 +87,7 @@ ffmpeg.wait()
87
87
  > - 🚀: Threaded `ffmpeg.stdin.write(buffer.read())` with a queue (similar to turbopipe)
88
88
  > - 🌀: The magic of `turbopipe.pipe(buffer, ffmpeg.stdin.fileno())`
89
89
  >
90
- > Also see [`benchmark.py`](examples/benchmark.py) for the implementation
90
+ > Also see [`benchmark.py`](https://github.com/BrokenSource/TurboPipe/blob/main/examples/benchmark.py) for the implementation
91
91
 
92
92
  ✅ Check out benchmarks in a couple of systems below:
93
93
 
@@ -52,8 +52,8 @@ def FFmpeg() -> Generator[subprocess.Popen, None, None]:
52
52
 
53
53
  @contextlib.contextmanager
54
54
  def Progress():
55
- with tqdm.tqdm(total=TOTAL_FRAMES, unit="Frame", smoothing=0) as frame_bar, \
56
- tqdm.tqdm(total=TOTAL_BYTES, unit="B", smoothing=0, unit_scale=True) as byte_bar:
55
+ with tqdm.tqdm(total=TOTAL_FRAMES, unit="Frame", smoothing=0, mininterval=1/30) as frame_bar, \
56
+ tqdm.tqdm(total=TOTAL_BYTES, unit="B", smoothing=0, mininterval=1/30, unit_scale=True) as byte_bar:
57
57
  def next():
58
58
  byte_bar.update(BYTES_PER_FRAME)
59
59
  frame_bar.update(1)
@@ -80,3 +80,4 @@ with Progress() as progress, FFmpeg() as ffmpeg:
80
80
  turbopipe.sync()
81
81
 
82
82
  turbopipe.close()
83
+
@@ -120,7 +120,7 @@ class Benchmark:
120
120
  process = subprocess.Popen(command, stdin=subprocess.PIPE)
121
121
  yield process
122
122
  finally:
123
- turbopipe.sync()
123
+ turbopipe.close()
124
124
  process.stdin.close()
125
125
  process.wait()
126
126
 
@@ -153,8 +153,7 @@ class Benchmark:
153
153
 
154
154
  for frame in tqdm.tqdm(
155
155
  desc=f"Processing (Run #{run}) ({method.value} {width}x{height})",
156
- iterable=range(total_frames),
157
- smoothing=0, unit=" Frame"
156
+ iterable=range(total_frames), smoothing=0, unit=" Frame", mininterval=1/30,
158
157
  ):
159
158
  buffer = buffers[frame % nbuffer]
160
159
 
@@ -9,16 +9,22 @@
9
9
  #define PY_SSIZE_T_CLEAN
10
10
  #include <Python.h>
11
11
 
12
+ // Standard library
13
+ #include <functional>
14
+ #include <iostream>
15
+ #include <chrono>
16
+
17
+ // Threading
18
+ #include <condition_variable>
12
19
  #include <thread>
13
20
  #include <mutex>
14
- #include <condition_variable>
15
- #include <iostream>
21
+
22
+ // Data structure
23
+ #include <unordered_set>
16
24
  #include <unordered_map>
17
25
  #include <deque>
18
- #include <chrono>
19
- #include <functional>
20
- #include <set>
21
26
 
27
+ // Third party
22
28
  #include "gl_methods.hpp"
23
29
 
24
30
  #define dict std::unordered_map
@@ -121,8 +127,8 @@ public:
121
127
 
122
128
  private:
123
129
  dict<int, dict<int, condition_variable>> pending;
130
+ dict<int, unordered_set<int>> queue;
124
131
  dict<int, deque<Work>> stream;
125
- dict<int, set<int>> queue;
126
132
  dict<int, thread> threads;
127
133
  dict<int, mutex> mutexes;
128
134
  condition_variable signal;
@@ -139,12 +145,12 @@ private:
139
145
  pending[file][hash].wait(lock, [this, file, hash] {
140
146
  return queue[file].find(hash) == queue[file].end();
141
147
  });
142
- pending[file].erase(hash);
143
- queue[file].insert(hash);
144
148
  }
145
149
 
146
150
  // Add another job to the queue
147
151
  stream[file].push_back(work);
152
+ queue[file].insert(hash);
153
+ this->running = true;
148
154
  lock.unlock();
149
155
 
150
156
  // Each file descriptor has its own thread
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env python3
2
- __version__ = "1.0.3"
2
+ __version__ = "1.0.4"
3
3
  print(__version__)
File without changes
File without changes
File without changes
File without changes
File without changes