plugins-workspace icon indicating copy to clipboard operation
plugins-workspace copied to clipboard

[log] Impact on request consumption time (Android emulator)

Open hanaTsuk1 opened this issue 2 years ago • 1 comments

In the Windows environment, the first screen takes a few seconds, and after refreshing, the request only takes a few hundred milliseconds In the Android environment, there is not much difference in time between the first screen and refresh, which takes one minute At the same time, the console warns "DevTools failed to load source map"

tauri = { version = "2.0.0-alpha.20" }

tauri-build = { version = "2.0.0-alpha.13"}

// vite.config.ts
  server: {
    port: 1420,
    strictPort: true,
    host: mobile ? '0.0.0.0' : false,
    hmr: mobile
      ? {
          protocol: 'ws',
          host: await internalIpV4(),
          port: 1421,
        }
      : undefined,
    watch: {
      // 3. tell vite to ignore watching `src-tauri`
      ignored: ['**/src-tauri/**'],
    },
  },

Originally posted by @hanaTsuk1 in https://github.com/tauri-apps/tauri/discussions/8471

hanaTsuk1 avatar Dec 27 '23 13:12 hanaTsuk1

When I comment out the code below, the request takes time reduced to normal

tauri-plugin-log = "2.0.0-alpha.6"

.plugin(
    tauri_plugin_log::Builder::new()
        .clear_targets()
        .targets([
            Target::new(TargetKind::LogDir {
                file_name: Some("webview".into()),
            })
            .filter(|metadata| metadata.target() == WEBVIEW_TARGET),
            Target::new(TargetKind::LogDir {
                file_name: Some("rust".into()),
            })
            .filter(|metadata| metadata.target() != WEBVIEW_TARGET),
            Target::new(TargetKind::Stdout),
            Target::new(TargetKind::Webview),
        ])
        .timezone_strategy(TimezoneStrategy::UseLocal)
        .build(),
)

hanaTsuk1 avatar Dec 27 '23 13:12 hanaTsuk1