File: 2001_profiling.patch

package info (click to toggle)
rust-subtile 0.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 632 kB
  • sloc: makefile: 2; sh: 1
file content (124 lines) | stat: -rw-r--r-- 3,933 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
Description: avoid not-in-Debian crate profiling
Author: Jonas Smedegaard <dr@jones.dk>
Forwarded: not-needed
Last-Update: 2024-03-23
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,7 +35,6 @@
 iter_fixed = "0.4"
 log = "0.4"
 nom = "7.1"
-profiling = "1.0"
 regex = "1.11"
 thiserror = "2.0"
 
--- a/src/vobsub/idx.rs
+++ b/src/vobsub/idx.rs
@@ -77,7 +77,6 @@
     ///
     /// # Errors
     /// Will return [`VobSubError::Io`] if failed to open of read `.idx` or ``.sub`` file.
-    #[profiling::function]
     pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, VobSubError> {
         let path = path.as_ref();
         let mkerr_idx = |source| VobSubError::Io {
@@ -98,7 +97,6 @@
     ///
     /// # Panics
     /// Panic if the Regex creation failed
-    #[profiling::function]
     pub fn read_index<T, Err>(mut input: BufReader<T>, mkerr: &Err) -> Result<Self, VobSubError>
     where
         T: std::io::Read,
--- a/src/vobsub/img.rs
+++ b/src/vobsub/img.rs
@@ -185,7 +185,6 @@
 /// Decompress a run-length encoded image, and return a vector in row-major
 /// order, starting at the upper-left and scanning right and down, with one
 /// byte for each 2-bit value.
-#[profiling::function]
 pub fn decompress(size: Size, data: &VobSubRleImageData) -> Result<Vec<u8>, Error> {
     trace!(
         "decompressing image {:?}, max: [0x{:x}, 0x{:x}]",
@@ -340,7 +339,6 @@
 {
     type Pixel = P;
 
-    #[profiling::function]
     fn to_image(&self) -> ImageBuffer<P, Vec<u8>>
     where
         P: Pixel<Subpixel = u8>,
@@ -394,7 +392,6 @@
 }
 
 impl ToOcrImage for VobSubOcrImage<'_> {
-    #[profiling::function]
     fn image(&self, opt: &ToOcrImageOpt) -> image::GrayImage {
         let width = self.indexed_img.width();
         let height = self.indexed_img.height();
--- a/src/vobsub/sub.rs
+++ b/src/vobsub/sub.rs
@@ -463,7 +463,6 @@
 
     // Read all pes_packets needed to parse a subtitle.
     fn next_sub_packet(&mut self) -> Option<Result<(f64, Vec<u8>), VobSubError>> {
-        profiling::scope!("VobsubParser next_sub_packet");
 
         // Get the `PES` packet containing the first chunk of our subtitle.
         let first: ps::PesPacket = try_iter!(self.pes_packets.next());
@@ -522,7 +521,6 @@
     type Item = Result<(TimeSpan, VobSubIndexedImage), VobSubError>;
 
     fn next(&mut self) -> Option<Self::Item> {
-        profiling::scope!("VobsubParser next");
 
         let (base_time, sub_packet) = try_iter!(self.next_sub_packet());
         let subtitle = subtitle::<(TimeSpan, VobSubIndexedImage), _>(&sub_packet, base_time);
--- a/src/image/utils.rs
+++ b/src/image/utils.rs
@@ -37,7 +37,6 @@
 /// # Errors
 /// Will return `DumpError::Folder` if the output folder creation failed.
 /// Will return `DumpError::DumpImage` if the dump of one image failed.
-#[profiling::function]
 pub fn dump_images<'a, Iter, Img, P, Container>(
     path: &str,
     images: Iter,
@@ -74,7 +73,6 @@
 }
 
 /// Dump one image
-#[profiling::function]
 fn dump_image<P, Pix, Container>(
     filename: P,
     image: &image::ImageBuffer<Pix, Container>, // image::Luma<u8>, Vec<u8>
--- a/src/pgs/pgs_image.rs
+++ b/src/pgs/pgs_image.rs
@@ -121,7 +121,6 @@
 {
     type Pixel = P;
 
-    #[profiling::function]
     fn to_image(&self) -> ImageBuffer<P, Vec<u8>>
     where
         P: Pixel<Subpixel = u8>,
@@ -146,7 +145,6 @@
 where
     C: Fn(LumaA<u8>) -> Luma<u8>,
 {
-    #[profiling::function]
     fn image(&self, opt: &ToOcrImageOpt) -> image::GrayImage {
         let width = self.rle_image.width();
         let height = self.rle_image.height();
--- a/src/pgs/sup.rs
+++ b/src/pgs/sup.rs
@@ -31,7 +31,6 @@
     }
 
     /// Create a parser for a `*.sup` file from the path of the file.
-    #[profiling::function]
     pub fn from_file<P>(path: P) -> Result<SupParser<BufReader<File>, Decoder>, PgsError>
     where
         P: AsRef<Path>,