performance

Android webview loading fail in API 21 and above

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-18 17:08:41
问题 I have an Android application that uses WebView and load a page. This application works on Android devices running API 16 or above . Android WebView Code: String URL = "https://sandbox.napas.com.vn/gateway/message"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_web_view); webview = (WebView) findViewById(R.id.webview); webview.getSettings().setJavaScriptEnabled(true); webview.getSettings().setAllowFileAccess

Android Camera2 RAW streaming

白昼怎懂夜的黑 提交于 2021-02-18 16:59:41
问题 I am very new to Android and trying to: Stream raw data from the camera (ImageFormat RAW_SENSOR) Process raw data Display processed results interactively It seems like raw data capture is only available in still capture mode. Is this correct ? If so would it be possible to perform repeated CaptureRequests for RAW images instead ? What kind of performance can be expected using a 13MP sensor ? Any reference code ? Many thanks in advance, Guillaume EDIT : Here is what I have done so far: Create

run `perf stat` on the output of `perf record`?

江枫思渺然 提交于 2021-02-18 16:58:30
问题 With perf (the Linux profiler), (v4.15.18), I can run perf stat $COMMAND to get some simple stats on the command. If I run perf record , it saves lots of data to a perf.data file. Can I run perf stat on the output of perf record ? So that I can look at the perf recorded data, but also get a simple overview? 回答1: perf stat uses hardware performance monitoring unit in counting mode, and perf record / perf report with perf.data file uses the same unit in overflow mode. In both modes hardware

run `perf stat` on the output of `perf record`?

不羁的心 提交于 2021-02-18 16:58:05
问题 With perf (the Linux profiler), (v4.15.18), I can run perf stat $COMMAND to get some simple stats on the command. If I run perf record , it saves lots of data to a perf.data file. Can I run perf stat on the output of perf record ? So that I can look at the perf recorded data, but also get a simple overview? 回答1: perf stat uses hardware performance monitoring unit in counting mode, and perf record / perf report with perf.data file uses the same unit in overflow mode. In both modes hardware

Python 3D interpolation speedup

你离开我真会死。 提交于 2021-02-18 15:21:55
问题 I have following code used to interpolate 3D volume data. Y, X, Z = np.shape(volume) xs = np.arange(0, X) ys = np.arange(0, Y) zs = np.arange(0, Z) points = list(zip(np.ravel(result[:, :, :, 1]), np.ravel(result[:, :, :, 0]), np.ravel(result[:, :, :, 2]))) interp = interpolate.RegularGridInterpolator((ys, xs, zs), volume, bounds_error=False, fill_value=0, method='linear') new_volume = interp(points) new_volume = np.reshape(new_volume, (Y, X, Z)) This code takes about 37 seconds to execute on

Python 3D interpolation speedup

▼魔方 西西 提交于 2021-02-18 15:21:48
问题 I have following code used to interpolate 3D volume data. Y, X, Z = np.shape(volume) xs = np.arange(0, X) ys = np.arange(0, Y) zs = np.arange(0, Z) points = list(zip(np.ravel(result[:, :, :, 1]), np.ravel(result[:, :, :, 0]), np.ravel(result[:, :, :, 2]))) interp = interpolate.RegularGridInterpolator((ys, xs, zs), volume, bounds_error=False, fill_value=0, method='linear') new_volume = interp(points) new_volume = np.reshape(new_volume, (Y, X, Z)) This code takes about 37 seconds to execute on

How does V8 optimise the creation of very large arrays?

戏子无情 提交于 2021-02-18 15:08:03
问题 Recently, I had to work on optimising a task that involved the creation of really large arrays (~ 10⁸ elements). I tested a few different methods, and, according to jsperf, the following option seemed to be the fastest. var max = 10000000; var arr = new Array(max); for (let i = 0; i < max; i++) { arr[i] = true; } Which was ~ 85% faster than var max = 10000000; var arr = []; for (let i = 0; i < max; i++) { arr.push(true); } And indeed, the first snippet was much faster in my actual app as well

How does V8 optimise the creation of very large arrays?

天涯浪子 提交于 2021-02-18 15:06:54
问题 Recently, I had to work on optimising a task that involved the creation of really large arrays (~ 10⁸ elements). I tested a few different methods, and, according to jsperf, the following option seemed to be the fastest. var max = 10000000; var arr = new Array(max); for (let i = 0; i < max; i++) { arr[i] = true; } Which was ~ 85% faster than var max = 10000000; var arr = []; for (let i = 0; i < max; i++) { arr.push(true); } And indeed, the first snippet was much faster in my actual app as well

How does V8 optimise the creation of very large arrays?

谁说胖子不能爱 提交于 2021-02-18 15:06:13
问题 Recently, I had to work on optimising a task that involved the creation of really large arrays (~ 10⁸ elements). I tested a few different methods, and, according to jsperf, the following option seemed to be the fastest. var max = 10000000; var arr = new Array(max); for (let i = 0; i < max; i++) { arr[i] = true; } Which was ~ 85% faster than var max = 10000000; var arr = []; for (let i = 0; i < max; i++) { arr.push(true); } And indeed, the first snippet was much faster in my actual app as well

Best way to create a setter function in C++

橙三吉。 提交于 2021-02-18 12:32:05
问题 I want to write a template function that receives parameter by move or by copy. The most efficient way that I use is: void setA(A a) { m_a = std::move(a); } Here, when we use is A a; setA(a); // <<---- one copy ctor & one move ctor setA(std::move(a)); // <<---- two move ctors I recently found out that defining it this way, with two functions: void setA(A&& a) { m_a = std::move(a); } void setA(const A& a) { m_a = a; // of course we can so "m_a = std::move(a);" too, since it will do nothing }