diff --git a/app/Support/Assets/AssetManifest.php b/app/Support/Assets/AssetManifest.php index 11505a7f..2a782d2f 100644 --- a/app/Support/Assets/AssetManifest.php +++ b/app/Support/Assets/AssetManifest.php @@ -170,7 +170,7 @@ public function slotProjection(): array /** * Only the active language's rendering text, loaded separately from geometry. - * English editorial assets keep their English text in every locale bundle. + * A blog figure keeps its English text in every language its text is not written in. * * @return array|null>> */ @@ -187,7 +187,7 @@ public function slotTextProjection(string $locale): array continue; } - $englishOnly = collect($entry['usedOn'])->every(fn(array $use): bool => str_starts_with($use['path'], '/blog/')); + $inPosts = self::onlyInPosts($entry); $fields = $entry['status'] === 'supplied' ? ['alt', 'caption'] : ['description']; $text = []; @@ -198,7 +198,7 @@ public function slotTextProjection(string $locale): array continue; } - $language = $englishOnly ? Locales::default() : $locale; + $language = $inPosts && ! is_string($entry[$field][$locale] ?? null) ? Locales::default() : $locale; $line = $entry[$field][$language] ?? null; if (! is_string($line) || trim($line) === '') { @@ -534,7 +534,12 @@ private function suppliedProblems(string $id, array $entry): array $sets = $entry['locale'] === 'per-locale' ? $src : ['shared' => $src]; if ($entry['locale'] === 'per-locale') { - foreach (Locales::codes() as $code) { + // A blog figure needs files only in the languages of its alt text; the rest of the site needs every language. + $codes = self::onlyInPosts($entry) + ? array_values(array_intersect(Locales::codes(), array_keys(array_filter($entry['alt'], 'is_string')))) + : Locales::codes(); + + foreach ($codes as $code) { if (! is_array($src[$code] ?? null)) { $problems[] = "{$id} is per-locale but has no {$code} sources."; } @@ -682,6 +687,11 @@ private function sourceProblems(string $label, array $source, array $kind, ?stri return $problems; } + private static function onlyInPosts(array $entry): bool + { + return collect($entry['usedOn'])->every(fn(array $use): bool => str_starts_with($use['path'], '/blog/')); + } + public static function mimeType(string $format): string { return $format === 'svg' ? 'image/svg+xml' : "image/{$format}"; diff --git a/docs/architecture.md b/docs/architecture.md index 28d9732d..13e4134a 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -515,7 +515,8 @@ The browser loads `resources/js/lib/data/asset-slots.json` for shared geometry and one `asset-locales/{locale}.json` catalog for the active language's text. The page resolver waits for that catalog before client or SSR rendering; the cache is keyed by locale so concurrent SSR requests cannot share the wrong -language. English editorial figures retain their English text. +language. A blog figure shows English in every language its text is not +written in, and a per-locale one has files only in the languages it is written in. `php artisan assets:handoff` writes these files and the owner's brief, `docs/visual-assets.md`, from the manifest and the per-family fragments in diff --git a/docs/localization.md b/docs/localization.md index 1068d810..83c5364c 100644 --- a/docs/localization.md +++ b/docs/localization.md @@ -27,7 +27,7 @@ Search metadata must fit the existing title and description budgets. The image manifest has native descriptions, alternatives and captions. `php artisan assets:handoff` generates shared geometry and separate language text files. The page resolver loads the requested text before SSR or hydration; concurrent requests cache by language rather than changing a global current language. -English editorial assets keep English text. Generate localized artwork using `scripts/assets/` and social cards +A blog figure shows English in every language its text is not written in. Generate localized artwork using `scripts/assets/` and social cards with `php artisan og:generate`, retaining the original geometry and source licensing. Run catalog, route, sitemap, asset and notification tests, TypeScript checks, and client/SSR builds before release. diff --git a/public/images/blog/blog-tablepro-0-88-performance-1-dark-en-1408.avif b/public/images/blog/blog-tablepro-0-88-performance-1-dark-en-1408.avif new file mode 100644 index 00000000..9ef820e9 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-1-dark-en-1408.avif differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-1-dark-en-1408.webp b/public/images/blog/blog-tablepro-0-88-performance-1-dark-en-1408.webp new file mode 100644 index 00000000..e5a896b1 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-1-dark-en-1408.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-1-dark-en-704.avif b/public/images/blog/blog-tablepro-0-88-performance-1-dark-en-704.avif new file mode 100644 index 00000000..dc64eb59 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-1-dark-en-704.avif differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-1-dark-en-704.webp b/public/images/blog/blog-tablepro-0-88-performance-1-dark-en-704.webp new file mode 100644 index 00000000..a41b9cff Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-1-dark-en-704.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-1-dark-vi-1408.avif b/public/images/blog/blog-tablepro-0-88-performance-1-dark-vi-1408.avif new file mode 100644 index 00000000..12ee7846 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-1-dark-vi-1408.avif differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-1-dark-vi-1408.webp b/public/images/blog/blog-tablepro-0-88-performance-1-dark-vi-1408.webp new file mode 100644 index 00000000..09232df1 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-1-dark-vi-1408.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-1-dark-vi-704.avif b/public/images/blog/blog-tablepro-0-88-performance-1-dark-vi-704.avif new file mode 100644 index 00000000..6b8ad32f Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-1-dark-vi-704.avif differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-1-dark-vi-704.webp b/public/images/blog/blog-tablepro-0-88-performance-1-dark-vi-704.webp new file mode 100644 index 00000000..29559cd2 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-1-dark-vi-704.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-1-light-en-1408.avif b/public/images/blog/blog-tablepro-0-88-performance-1-light-en-1408.avif new file mode 100644 index 00000000..210da26b Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-1-light-en-1408.avif differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-1-light-en-1408.webp b/public/images/blog/blog-tablepro-0-88-performance-1-light-en-1408.webp new file mode 100644 index 00000000..462a5970 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-1-light-en-1408.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-1-light-en-704.avif b/public/images/blog/blog-tablepro-0-88-performance-1-light-en-704.avif new file mode 100644 index 00000000..467952ba Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-1-light-en-704.avif differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-1-light-en-704.webp b/public/images/blog/blog-tablepro-0-88-performance-1-light-en-704.webp new file mode 100644 index 00000000..58e4ebdf Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-1-light-en-704.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-1-light-vi-1408.avif b/public/images/blog/blog-tablepro-0-88-performance-1-light-vi-1408.avif new file mode 100644 index 00000000..27dba283 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-1-light-vi-1408.avif differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-1-light-vi-1408.webp b/public/images/blog/blog-tablepro-0-88-performance-1-light-vi-1408.webp new file mode 100644 index 00000000..7fd8f3ec Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-1-light-vi-1408.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-1-light-vi-704.avif b/public/images/blog/blog-tablepro-0-88-performance-1-light-vi-704.avif new file mode 100644 index 00000000..9ee9ea6f Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-1-light-vi-704.avif differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-1-light-vi-704.webp b/public/images/blog/blog-tablepro-0-88-performance-1-light-vi-704.webp new file mode 100644 index 00000000..7bc85222 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-1-light-vi-704.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-2-dark-en-1408.avif b/public/images/blog/blog-tablepro-0-88-performance-2-dark-en-1408.avif new file mode 100644 index 00000000..3123ff7b Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-2-dark-en-1408.avif differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-2-dark-en-1408.webp b/public/images/blog/blog-tablepro-0-88-performance-2-dark-en-1408.webp new file mode 100644 index 00000000..1d45acdc Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-2-dark-en-1408.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-2-dark-en-704.avif b/public/images/blog/blog-tablepro-0-88-performance-2-dark-en-704.avif new file mode 100644 index 00000000..aaebd20b Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-2-dark-en-704.avif differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-2-dark-en-704.webp b/public/images/blog/blog-tablepro-0-88-performance-2-dark-en-704.webp new file mode 100644 index 00000000..d9c386a4 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-2-dark-en-704.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-2-dark-vi-1408.avif b/public/images/blog/blog-tablepro-0-88-performance-2-dark-vi-1408.avif new file mode 100644 index 00000000..9244a3e8 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-2-dark-vi-1408.avif differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-2-dark-vi-1408.webp b/public/images/blog/blog-tablepro-0-88-performance-2-dark-vi-1408.webp new file mode 100644 index 00000000..e01d12bc Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-2-dark-vi-1408.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-2-dark-vi-704.avif b/public/images/blog/blog-tablepro-0-88-performance-2-dark-vi-704.avif new file mode 100644 index 00000000..60debe9c Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-2-dark-vi-704.avif differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-2-dark-vi-704.webp b/public/images/blog/blog-tablepro-0-88-performance-2-dark-vi-704.webp new file mode 100644 index 00000000..d5a82f6b Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-2-dark-vi-704.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-2-light-en-1408.avif b/public/images/blog/blog-tablepro-0-88-performance-2-light-en-1408.avif new file mode 100644 index 00000000..6f4a5837 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-2-light-en-1408.avif differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-2-light-en-1408.webp b/public/images/blog/blog-tablepro-0-88-performance-2-light-en-1408.webp new file mode 100644 index 00000000..7e852c78 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-2-light-en-1408.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-2-light-en-704.avif b/public/images/blog/blog-tablepro-0-88-performance-2-light-en-704.avif new file mode 100644 index 00000000..76d86156 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-2-light-en-704.avif differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-2-light-en-704.webp b/public/images/blog/blog-tablepro-0-88-performance-2-light-en-704.webp new file mode 100644 index 00000000..55bf2660 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-2-light-en-704.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-2-light-vi-1408.avif b/public/images/blog/blog-tablepro-0-88-performance-2-light-vi-1408.avif new file mode 100644 index 00000000..0dace50d Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-2-light-vi-1408.avif differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-2-light-vi-1408.webp b/public/images/blog/blog-tablepro-0-88-performance-2-light-vi-1408.webp new file mode 100644 index 00000000..cd44fcbe Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-2-light-vi-1408.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-2-light-vi-704.avif b/public/images/blog/blog-tablepro-0-88-performance-2-light-vi-704.avif new file mode 100644 index 00000000..5e766c0f Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-2-light-vi-704.avif differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-2-light-vi-704.webp b/public/images/blog/blog-tablepro-0-88-performance-2-light-vi-704.webp new file mode 100644 index 00000000..f30c44af Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-2-light-vi-704.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-3-light-1408.webp b/public/images/blog/blog-tablepro-0-88-performance-3-light-1408.webp new file mode 100644 index 00000000..3de7336a Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-3-light-1408.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-3-light.mp4 b/public/images/blog/blog-tablepro-0-88-performance-3-light.mp4 new file mode 100644 index 00000000..fc9a102d Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-3-light.mp4 differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-3-light.webm b/public/images/blog/blog-tablepro-0-88-performance-3-light.webm new file mode 100644 index 00000000..da302b67 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-3-light.webm differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-4-light-1408.webp b/public/images/blog/blog-tablepro-0-88-performance-4-light-1408.webp new file mode 100644 index 00000000..4f7e2767 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-4-light-1408.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-4-light.mp4 b/public/images/blog/blog-tablepro-0-88-performance-4-light.mp4 new file mode 100644 index 00000000..e8c1752c Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-4-light.mp4 differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-4-light.webm b/public/images/blog/blog-tablepro-0-88-performance-4-light.webm new file mode 100644 index 00000000..e74294ed Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-4-light.webm differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-5-light-1408.webp b/public/images/blog/blog-tablepro-0-88-performance-5-light-1408.webp new file mode 100644 index 00000000..4c9484e7 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-5-light-1408.webp differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-5-light.mp4 b/public/images/blog/blog-tablepro-0-88-performance-5-light.mp4 new file mode 100644 index 00000000..a9eb3636 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-5-light.mp4 differ diff --git a/public/images/blog/blog-tablepro-0-88-performance-5-light.webm b/public/images/blog/blog-tablepro-0-88-performance-5-light.webm new file mode 100644 index 00000000..4a064768 Binary files /dev/null and b/public/images/blog/blog-tablepro-0-88-performance-5-light.webm differ diff --git a/public/og/blog/tablepro-0-88-performance.png b/public/og/blog/tablepro-0-88-performance.png new file mode 100644 index 00000000..01980c54 Binary files /dev/null and b/public/og/blog/tablepro-0-88-performance.png differ diff --git a/public/og/vi/blog/tablepro-0-88-performance.png b/public/og/vi/blog/tablepro-0-88-performance.png new file mode 100644 index 00000000..a2d6f939 Binary files /dev/null and b/public/og/vi/blog/tablepro-0-88-performance.png differ diff --git a/resources/blog/tablepro-0-88-performance.md b/resources/blog/tablepro-0-88-performance.md new file mode 100644 index 00000000..0c97b352 --- /dev/null +++ b/resources/blog/tablepro-0-88-performance.md @@ -0,0 +1,116 @@ +--- +slug: tablepro-0-88-performance +title: "Where TablePro 0.88 got faster" +description: "Fewer round trips to MySQL and PostgreSQL, a wider SSH window, batched imports and leaner exports, measured against 0.87 on the same Mac." +date: 2026-11-21 +kind: news +author: Ngô Quốc Đạt +tags: [mysql, postgresql, ssh, export, import] +ogPunchline: "A PostgreSQL dump imports 16 times faster. An SSH tunnel moves 13 times more per second." +--- + +Most of my time on TablePro 0.88 went into speed. It's in beta now. On a database 200 ms away, a MySQL query with the row limit comes back in 214 ms instead of 830. A 66 MB result crosses an SSH tunnel in 0.68 seconds instead of 8.9. A 642-statement PostgreSQL dump imports in 8.6 seconds instead of two minutes and 18. + +Every number here compares 0.87.0 with 0.88.0-beta.2 on the same Mac and the same data. How I measured is at the end. + + + +| What you do | 0.87.0 | 0.88 beta | Faster | +|---|---|---|---| +| Import a PostgreSQL dump, 642 statements * | 137.5 s | 8.6 s | 16x | +| Read a 66 MB result through an SSH tunnel * | 8.9 s | 0.68 s | 13x | +| Export 200,000 rows to CSV | 0.98 s | 0.12 s | 8x | +| `SELECT * FROM orders` on MySQL, row limit on * | 830 ms | 214 ms | 3.9x | +| A MySQL query with its own `LIMIT` * | 411 ms | 204 ms | 2x | +| Next page of a MySQL table * | 413 ms | 206 ms | 2x | +| Open a PostgreSQL table * | 2.11 s | 1.29 s | 1.6x | + +\* 200 ms away, through a proxy that delays every packet. + +## Round trips, not queries {#round-trips} + +When your database is far away, most of the wait isn't the database working. It's messages crossing the network. From Vietnam to a server in the US, each trip there and back costs about 200 ms, and TablePro was making trips it didn't need. + +Here's what 0.87 sent to MySQL to run `SELECT * FROM orders` with the default row limit, read from the proxy's log: + +```sql +SET SQL_SELECT_LIMIT = 18446744073709551615; -- lift the limit for the next line +USE `shop`; -- make sure we're on your database +SET SQL_SELECT_LIMIT = 10001; -- cap your query at 10,000 rows +SELECT * FROM orders; +``` + +Four statements, and each one waited for the server before the next went out. That's four round trips, 830 ms, for a query the server answers in under a millisecond. + +0.88 keeps track of which database the session is on and skips the `USE` when nothing could have moved it. With no `USE`, there's nothing to lift the limit for. The limit and your query go out together: + + + +The same trick halves paging. Next page was a `USE` plus the page query, 413 ms. Now it's the page query alone, 206 ms. A side effect I like: `ROW_COUNT()` and `SHOW WARNINGS` now answer for your last statement instead of for a `USE` you never typed. + + + +PostgreSQL had the same problem in a different place. Opening a table showed its first rows after one round trip in both versions, about 205 ms. What came after was slow: reading the table's columns took five queries, one after another, 1,040 ms. 0.88 sends the five together, 216 ms, and the whole open, with keys and the row count, went from 2.11 to 1.29 seconds. + +## A wider SSH window {#ssh-window} + +An SSH tunnel carries data in channels, and each channel has a window. The server may send that many bytes, then it has to wait until TablePro says it has room for more. libssh2 opens tunnel channels with a 2 MB window. Over a 200 ms link that's a ceiling you can't get past: 2 MB per 0.2 s is 10 MB/s, however fast your connection is. 0.87 moved 7.4 MB/s. + +0.88 opens its tunnel channels itself, with a 32 MB window: + +```swift +libssh2_channel_open_ex( + session, "direct-tcpip", 12, + 33_554_432, // receive window, 32 MiB instead of libssh2's 2 MiB + 32_768, message, messageLength) +``` + +A `SELECT` returning 66 MB of rows took 43 round trips in 0.87 and 4 in 0.88. It now takes 0.68 seconds instead of 8.9, about 96 MB/s. + +The cost is memory: a tunnel whose reader stalls can now hold up to 32 MB per channel before the server stops sending. + +## Importing a dump in batches {#batched-imports} + +A SQL import sent one statement, waited for the answer, then sent the next. A `pg_dump --inserts` file of 642 statements meant 661 round trips. At 200 ms each, that's over two minutes of waiting for a file that's 59 KB. + +0.88 uses libpq's pipeline mode for PostgreSQL. With **Wrap in transaction** on, it sends up to 200 statements or 4 MB at once, then reads the answers. Simplified: + +```swift +PQenterPipelineMode(conn) +for statement in batch { PQsendQueryParams(conn, statement, ...) } +PQsendPipelineSync(conn) +// then read one result per statement +``` + +The first failure still stops the import at the right line and rolls the transaction back. The same file now takes 37 round trips and 8.6 seconds instead of 137.5. TablePro's own import dialog says 133 and 4.5 seconds. The times here also count the sidebar refresh that runs after an import. MySQL imports still go one statement at a time. + + + +## Exports that skip work {#exports} + +This one has nothing to do with the network. The CSV exporter wrote every value with its own small write and ran the quoting rules on every value, even plain numbers. 0.88 buffers 1 MB between writes and scans each value's bytes first: when nothing needs quoting, the value goes out as is. JSON got the same treatment. + +Exporting 200,000 rows of a local SQLite table went from 0.98 to 0.12 seconds, and both versions wrote the same 15.8 MB file, byte for byte. Both still take about two seconds after you press **Save** before the first byte is written, which I haven't looked at yet. + + + +## What it cost, and what didn't change {#trade-offs} + +- An SSH tunnel can hold more memory when its reader stalls, and a Parquet export of a huge table spends a little more CPU to stay under a memory cap. Both are trades I made on purpose. +- On a database on your own Mac or LAN, a round trip costs well under a millisecond, so the network gains mostly disappear there. The export gains don't depend on the network. +- MySQL imports still send one statement at a time. +- Opening a MySQL table got only a little faster, 1.10 to 0.88 seconds. Its first page now shows in 205 ms instead of 411, but the metadata reads after it still take three more round trips. + +## How I measured {#how-i-measured} + +- A Mac mini with an M4 Pro and 24 GB of memory, macOS 27.0.1. +- MySQL 8.4.13, PostgreSQL 17.12 and OpenSSH 10.3 in Docker on the same Mac. +- Every connection goes through a small proxy that holds each packet for 100 ms in each direction, so every round trip costs 200 ms. For the SSH test, the delay sits on the SSH link and MySQL is behind it. +- 0.87.0 from its GitHub release and 0.88.0-beta.2, each in its own clean profile, against the same data. +- One warm-up run, then five measured runs. The tables show the median. Fastest and slowest runs of a test were within 8% of each other, except the CSV export on 0.87, which varied by 20%. Network times run from the first byte TablePro sends to the last byte it receives, read from the proxy's log, and round trips are counted from the same log. + +The changes, each with its own notes and benchmarks, are in pull requests [#4328](https://github.com/TableProApp/TablePro/pull/4328), [#4331](https://github.com/TableProApp/TablePro/pull/4331), [#4333](https://github.com/TableProApp/TablePro/pull/4333), [#4341](https://github.com/TableProApp/TablePro/pull/4341) and [#4356](https://github.com/TableProApp/TablePro/pull/4356). + +## Trying it {#trying-it} + +0.88 is in beta. Turn it on in **Settings > General > Update channel**, pick **Beta**, and check for updates. If something is still slow for you, open an issue with the database, roughly how far away it is, and what you did. diff --git a/resources/blog/vi/tablepro-0-88-performance.md b/resources/blog/vi/tablepro-0-88-performance.md new file mode 100644 index 00000000..3ec9d14e --- /dev/null +++ b/resources/blog/vi/tablepro-0-88-performance.md @@ -0,0 +1,116 @@ +--- +slug: tablepro-0-88-performance +title: "TablePro 0.88 nhanh hơn ở đâu" +description: "Ít lượt đi về hơn với MySQL và PostgreSQL, cửa sổ SSH rộng hơn, import theo lô và export gọn hơn, đo so với 0.87 trên cùng một máy Mac." +date: 2026-11-21 +kind: news +author: Ngô Quốc Đạt +tags: [mysql, postgresql, ssh, export, import] +ogPunchline: "Import dump PostgreSQL nhanh gấp 16 lần. SSH tunnel chở được gấp 13 lần mỗi giây." +--- + +Phần lớn thời gian mình làm TablePro 0.88 là dành cho tốc độ. Bản này đang ở beta. Với một database ở xa 200 ms, query MySQL có giới hạn dòng trả về sau 214 ms thay vì 830 ms. Kết quả 66 MB qua SSH tunnel mất 0.68 giây thay vì 8.9 giây. Một bản dump PostgreSQL 642 câu lệnh import xong trong 8.6 giây thay vì 2 phút 18 giây. + +Mọi con số trong bài đều so 0.87.0 với 0.88.0-beta.2 trên cùng một máy Mac, cùng dữ liệu. Cách đo nằm ở cuối bài. + + + +| Thao tác | 0.87.0 | 0.88 beta | Nhanh hơn | +|---|---|---|---| +| Import dump PostgreSQL, 642 câu lệnh * | 137.5 s | 8.6 s | 16x | +| Đọc kết quả 66 MB qua SSH tunnel * | 8.9 s | 0.68 s | 13x | +| Export 200.000 dòng ra CSV | 0.98 s | 0.12 s | 8x | +| `SELECT * FROM orders` trên MySQL, có giới hạn dòng * | 830 ms | 214 ms | 3.9x | +| Query MySQL có sẵn `LIMIT` * | 411 ms | 204 ms | 2x | +| Sang trang tiếp của bảng MySQL * | 413 ms | 206 ms | 2x | +| Mở một bảng PostgreSQL * | 2.11 s | 1.29 s | 1.6x | + +\* Ở xa 200 ms, qua một proxy làm trễ mọi gói tin. + +## Lượt đi về, không phải query {#round-trips} + +Khi database ở xa, phần lớn thời gian chờ không phải do database đang làm việc. Đó là thời gian gói tin chạy qua mạng. Từ Việt Nam sang một server ở Mỹ, mỗi lượt đi rồi về mất khoảng 200 ms, và TablePro đang đi những lượt không cần thiết. + +Đây là những gì 0.87 gửi cho MySQL để chạy `SELECT * FROM orders` với giới hạn dòng mặc định, đọc từ log của proxy: + +```sql +SET SQL_SELECT_LIMIT = 18446744073709551615; -- bỏ giới hạn cho dòng tiếp theo +USE `shop`; -- chắc chắn đang ở đúng database +SET SQL_SELECT_LIMIT = 10001; -- giới hạn query của bạn ở 10.000 dòng +SELECT * FROM orders; +``` + +Bốn câu lệnh, câu nào cũng chờ server trả lời rồi câu sau mới được gửi. Tức là bốn lượt đi về, 830 ms, cho một query mà server trả lời chưa tới một mili giây. + +0.88 nhớ session đang ở database nào và bỏ `USE` khi không có gì có thể đổi nó. Không có `USE` thì cũng không cần bỏ giới hạn. Giới hạn và query của bạn đi chung một lượt: + + + +Cùng cách đó làm việc sang trang nhanh gấp đôi. Trước đây sang trang là một `USE` cộng câu query trang, 413 ms. Giờ chỉ còn câu query trang, 206 ms. Một thay đổi kèm theo mà mình thích: `ROW_COUNT()` và `SHOW WARNINGS` giờ trả lời cho câu lệnh cuối của bạn, chứ không phải cho một câu `USE` bạn chưa từng gõ. + + + +PostgreSQL cũng bị y vậy ở chỗ khác. Ở cả hai bản, mở một bảng thì sau một lượt đi về, khoảng 205 ms, là thấy những dòng đầu tiên. Chậm là phần sau đó: đọc danh sách cột của bảng tốn năm query, chạy lần lượt, mất 1040 ms. 0.88 gửi năm query đó cùng lúc, còn 216 ms, và cả lần mở bảng, gồm khoá và đếm dòng, giảm từ 2.11 xuống 1.29 giây. + +## Cửa sổ SSH rộng hơn {#ssh-window} + +SSH tunnel chở dữ liệu qua các channel, và mỗi channel có một cửa sổ. Server được gửi tối đa bấy nhiêu byte, rồi phải chờ TablePro báo còn chỗ mới gửi tiếp. libssh2 mở channel cho tunnel với cửa sổ 2 MB. Qua đường truyền 200 ms, đó là cái trần không vượt qua được: 2 MB mỗi 0.2 giây là 10 MB/s, dù mạng của bạn nhanh cỡ nào. 0.87 đạt 7.4 MB/s. + +0.88 tự mở channel cho tunnel, với cửa sổ 32 MB: + +```swift +libssh2_channel_open_ex( + session, "direct-tcpip", 12, + 33_554_432, // cửa sổ nhận 32 MiB thay vì 2 MiB của libssh2 + 32_768, message, messageLength) +``` + +Một câu `SELECT` trả về 66 MB dữ liệu tốn 43 lượt đi về ở 0.87 và 4 lượt ở 0.88. Giờ chỉ mất 0.68 giây thay vì 8.9 giây, khoảng 96 MB/s. + +Cái giá là bộ nhớ: một tunnel mà phía đọc bị chậm giờ có thể giữ tới 32 MB mỗi channel rồi server mới ngừng gửi. + +## Import dump theo lô {#batched-imports} + +Import SQL trước đây gửi một câu lệnh, chờ trả lời, rồi mới gửi câu tiếp. Một file `pg_dump --inserts` 642 câu lệnh là 661 lượt đi về. Mỗi lượt 200 ms thì phải chờ hơn hai phút cho một file chỉ 59 KB. + +0.88 dùng pipeline mode của libpq cho PostgreSQL. Khi bật **Wrap in transaction**, app gửi tối đa 200 câu lệnh hoặc 4 MB một lần, rồi mới đọc câu trả lời. Rút gọn: + +```swift +PQenterPipelineMode(conn) +for statement in batch { PQsendQueryParams(conn, statement, ...) } +PQsendPipelineSync(conn) +// rồi đọc một kết quả cho mỗi câu lệnh +``` + +Câu lệnh lỗi đầu tiên vẫn dừng import đúng dòng và rollback transaction. Cùng file đó giờ chỉ tốn 37 lượt đi về và 8.6 giây thay vì 137.5 giây. Hộp thoại import của TablePro báo 133 và 4.5 giây. Thời gian trong bài tính cả lượt làm mới sidebar chạy sau khi import. Import MySQL thì vẫn gửi từng câu một. + + + +## Export bớt việc thừa {#exports} + +Phần này không liên quan tới mạng. Bộ export CSV trước đây ghi mỗi giá trị bằng một lần ghi nhỏ, và chạy quy tắc đặt dấu nháy cho mọi giá trị, kể cả số. 0.88 gom 1 MB rồi mới ghi, và quét byte của từng giá trị trước: nếu không có gì cần đặt nháy thì giá trị được ghi nguyên như vậy. JSON cũng được làm tương tự. + +Export 200.000 dòng của một bảng SQLite trên máy giảm từ 0.98 xuống 0.12 giây, và hai bản ghi ra cùng một file 15.8 MB, giống nhau từng byte. Cả hai vẫn mất khoảng hai giây từ lúc bấm **Save** tới khi byte đầu tiên được ghi, chỗ này mình chưa xem tới. + + + +## Cái giá, và những gì chưa đổi {#trade-offs} + +- SSH tunnel có thể giữ nhiều bộ nhớ hơn khi phía đọc bị chậm, và export Parquet một bảng rất lớn tốn CPU hơn một chút để giữ bộ nhớ dưới mức trần. Cả hai là đánh đổi mình chọn có chủ ý. +- Với database ngay trên máy hoặc trong mạng LAN, mỗi lượt đi về chưa tới một mili giây, nên phần nhanh hơn nhờ mạng gần như không còn. Phần export thì không phụ thuộc vào mạng. +- Import MySQL vẫn gửi từng câu lệnh một. +- Mở một bảng MySQL chỉ nhanh hơn một chút, từ 1.10 xuống 0.88 giây. Trang đầu giờ hiện sau 205 ms thay vì 411 ms, nhưng phần đọc metadata sau đó vẫn tốn thêm ba lượt đi về. + +## Mình đo như thế nào {#how-i-measured} + +- Mac mini M4 Pro, 24 GB bộ nhớ, macOS 27.0.1. +- MySQL 8.4.13, PostgreSQL 17.12 và OpenSSH 10.3 chạy trong Docker trên cùng máy. +- Mọi kết nối đi qua một proxy nhỏ giữ mỗi gói tin 100 ms theo mỗi chiều, nên mỗi lượt đi về tốn 200 ms. Với bài đo SSH, độ trễ nằm trên đường SSH và MySQL đứng sau nó. +- 0.87.0 lấy từ bản release trên GitHub và 0.88.0-beta.2, mỗi bản một profile sạch riêng, chạy trên cùng dữ liệu. +- Một lần chạy khởi động, rồi năm lần đo. Bảng ghi trung vị. Lần nhanh nhất và chậm nhất của mỗi bài đo chênh nhau dưới 8%, trừ export CSV trên 0.87, chênh 20%. Thời gian qua mạng tính từ byte đầu tiên TablePro gửi tới byte cuối cùng nó nhận, đọc từ log của proxy, và số lượt đi về cũng đếm từ log đó. + +Các thay đổi, mỗi cái kèm ghi chú và benchmark riêng, nằm trong các pull request [#4328](https://github.com/TableProApp/TablePro/pull/4328), [#4331](https://github.com/TableProApp/TablePro/pull/4331), [#4333](https://github.com/TableProApp/TablePro/pull/4333), [#4341](https://github.com/TableProApp/TablePro/pull/4341) và [#4356](https://github.com/TableProApp/TablePro/pull/4356). + +## Thử bản beta {#trying-it} + +0.88 đang ở beta. Vào **Settings > General > Update channel**, chọn **Beta** rồi kiểm tra cập nhật. Chỗ nào bạn thấy vẫn chậm, cứ mở một issue, ghi database gì, ở xa cỡ nào và bạn đã làm gì. diff --git a/resources/data/assets.json b/resources/data/assets.json index 0cfb852d..7bd30097 100644 --- a/resources/data/assets.json +++ b/resources/data/assets.json @@ -9501,6 +9501,341 @@ "legacySource": [ "/images/blog/linux-beta-connect.png" ] + }, + "blog-tablepro-0-88-performance-1": { + "kind": "figure", + "type": "detail", + "family": "blog", + "ownerRepo": "web", + "slot": true, + "handoffPriority": "P3", + "usedOn": [ + { + "path": "/blog/tablepro-0-88-performance", + "section": "figure-1" + } + ], + "aspect": "1216:928", + "priority": false, + "theme": "both", + "locale": "per-locale", + "mobile": null, + "description": { + "en": "Bar chart: six tasks timed on TablePro 0.87.0 and 0.88 beta, with how many times faster each one got.", + "vi": "Biểu đồ cột: sáu thao tác đo trên TablePro 0.87.0 và 0.88 beta, kèm mức nhanh hơn của từng thao tác." + }, + "alt": { + "en": "A bar chart of six tasks timed on TablePro 0.87.0 in gray and 0.88 beta in orange, from a PostgreSQL dump import at 137.5 s against 8.59 s down to opening a PostgreSQL table at 2,114 ms against 1,287 ms, with the speedup of each row, from 16x to 1.6x, on the right.", + "vi": "Biểu đồ cột sáu thao tác đo trên TablePro 0.87.0 màu xám và 0.88 beta màu cam, từ import một bản dump PostgreSQL, 137.5 s so với 8.59 s, tới mở một bảng PostgreSQL, 2114 ms so với 1287 ms, với mức nhanh hơn của từng dòng, từ 16x tới 1.6x, ở bên phải." + }, + "caption": { + "en": "Every task is faster on 0.88, from 1.6 times for opening a PostgreSQL table to 16 times for a dump import.", + "vi": "Thao tác nào cũng nhanh hơn trên 0.88, từ 1.6 lần khi mở một bảng PostgreSQL tới 16 lần khi import dump." + }, + "replacement": { + "dir": "public/images/blog", + "base": "blog-tablepro-0-88-performance-1" + }, + "status": "supplied", + "src": { + "en": { + "light": { + "widths": [ + 704, + 1408 + ], + "formats": [ + "avif", + "webp" + ], + "width": 1408, + "height": 1075 + }, + "dark": { + "widths": [ + 704, + 1408 + ], + "formats": [ + "avif", + "webp" + ], + "width": 1408, + "height": 1075 + } + }, + "vi": { + "light": { + "widths": [ + 704, + 1408 + ], + "formats": [ + "avif", + "webp" + ], + "width": 1408, + "height": 1075 + }, + "dark": { + "widths": [ + 704, + 1408 + ], + "formats": [ + "avif", + "webp" + ], + "width": 1408, + "height": 1075 + } + } + }, + "legacySource": null + }, + "blog-tablepro-0-88-performance-2": { + "kind": "figure", + "type": "detail", + "family": "blog", + "ownerRepo": "web", + "slot": true, + "handoffPriority": "P3", + "usedOn": [ + { + "path": "/blog/tablepro-0-88-performance", + "section": "figure-2" + } + ], + "aspect": "1216:684", + "priority": false, + "theme": "both", + "locale": "per-locale", + "mobile": null, + "description": { + "en": "Round-trip diagram: what 0.87.0 and 0.88 beta send to MySQL for one SELECT with the row limit on.", + "vi": "Sơ đồ lượt đi về: những gì 0.87.0 và 0.88 beta gửi cho MySQL với một câu SELECT khi bật giới hạn dòng." + }, + "alt": { + "en": "A round-trip diagram of SELECT * FROM orders on MySQL 200 ms away, where 0.87.0 on the left sends SET SQL_SELECT_LIMIT, USE `shop`, SET SQL_SELECT_LIMIT = 10001 and the SELECT one at a time for 4 round trips and 830 ms, and 0.88 beta on the right sends the limit and the SELECT together for 1 round trip and 214 ms.", + "vi": "Sơ đồ lượt đi về của SELECT * FROM orders trên MySQL ở xa 200 ms, trong đó 0.87.0 bên trái gửi lần lượt SET SQL_SELECT_LIMIT, USE `shop`, SET SQL_SELECT_LIMIT = 10001 rồi câu SELECT, tốn 4 lượt và 830 ms, còn 0.88 beta bên phải gửi giới hạn và câu SELECT cùng lúc, 1 lượt và 214 ms." + }, + "caption": { + "en": "Without the USE, the limit and the query share one round trip instead of taking four.", + "vi": "Không còn USE, giới hạn và query đi chung một lượt thay vì bốn lượt." + }, + "replacement": { + "dir": "public/images/blog", + "base": "blog-tablepro-0-88-performance-2" + }, + "status": "supplied", + "src": { + "en": { + "light": { + "widths": [ + 704, + 1408 + ], + "formats": [ + "avif", + "webp" + ], + "width": 1408, + "height": 792 + }, + "dark": { + "widths": [ + 704, + 1408 + ], + "formats": [ + "avif", + "webp" + ], + "width": 1408, + "height": 792 + } + }, + "vi": { + "light": { + "widths": [ + 704, + 1408 + ], + "formats": [ + "avif", + "webp" + ], + "width": 1408, + "height": 792 + }, + "dark": { + "widths": [ + 704, + 1408 + ], + "formats": [ + "avif", + "webp" + ], + "width": 1408, + "height": 792 + } + } + }, + "legacySource": null + }, + "blog-tablepro-0-88-performance-3": { + "kind": "video", + "type": "video", + "family": "blog", + "ownerRepo": "web", + "slot": true, + "handoffPriority": "P3", + "usedOn": [ + { + "path": "/blog/tablepro-0-88-performance", + "section": "figure-3" + } + ], + "aspect": "1408:486", + "priority": false, + "theme": "single", + "locale": "shared", + "mobile": null, + "description": { + "en": "Clip: paging through a MySQL table on 0.87.0 and 0.88 beta side by side, 200 ms away.", + "vi": "Clip: sang trang một bảng MySQL trên 0.87.0 và 0.88 beta đặt cạnh nhau, ở xa 200 ms." + }, + "alt": { + "en": "Two TablePro windows side by side on the orders table of a MySQL connection named Shop, 0.87.0 on the left and 0.88 beta on the right, each opening the table and paging from page 1 to page 4 of 100, 1,000 rows at a time.", + "vi": "Hai cửa sổ TablePro đặt cạnh nhau trên bảng orders của connection MySQL tên Shop, 0.87.0 bên trái và 0.88 beta bên phải, mỗi bên mở bảng rồi sang từ trang 1 tới trang 4 trên 100, mỗi trang 1.000 dòng." + }, + "caption": { + "en": "With one round trip per page instead of two, 0.88 beta gets to each page first.", + "vi": "Mỗi lần sang trang chỉ còn một lượt đi về thay vì hai, nên 0.88 beta tới mỗi trang trước." + }, + "replacement": { + "dir": "public/images/blog", + "base": "blog-tablepro-0-88-performance-3" + }, + "status": "supplied", + "src": { + "light": { + "widths": [ + 1408 + ], + "formats": [ + "webp", + "webm", + "mp4" + ], + "width": 1408, + "height": 486 + } + }, + "legacySource": null + }, + "blog-tablepro-0-88-performance-4": { + "kind": "video", + "type": "video", + "family": "blog", + "ownerRepo": "web", + "slot": true, + "handoffPriority": "P3", + "usedOn": [ + { + "path": "/blog/tablepro-0-88-performance", + "section": "figure-4" + } + ], + "aspect": "1408:486", + "priority": false, + "theme": "single", + "locale": "shared", + "mobile": null, + "description": { + "en": "Clip: importing the same PostgreSQL dump on 0.87.0 and 0.88 beta side by side, at 8x speed.", + "vi": "Clip: import cùng một bản dump PostgreSQL trên 0.87.0 và 0.88 beta đặt cạnh nhau, tua nhanh 8x." + }, + "alt": { + "en": "Two TablePro import sheets side by side for src-dump.sql, 59 KB and 642 statements, with Wrap in transaction on, 0.87.0 on the left and 0.88 beta on the right under a timer at 8x speed, where 0.88 beta shows Import completed after 4.39 seconds while 0.87.0 stays at 0 of 642 statements until it completes after 131.97 seconds.", + "vi": "Hai sheet import của TablePro đặt cạnh nhau cho file src-dump.sql, 59 KB và 642 câu lệnh, với Wrap in transaction đang bật, 0.87.0 bên trái và 0.88 beta bên phải dưới một đồng hồ tua nhanh 8x, trong đó 0.88 beta báo Import completed sau 4.39 giây còn 0.87.0 đứng ở 0 of 642 statements cho tới khi xong sau 131.97 giây." + }, + "caption": { + "en": "The same 642-statement dump, 200 ms away: 0.88 finishes in seconds, and 0.87 takes over two minutes.", + "vi": "Cùng một bản dump 642 câu lệnh, ở xa 200 ms: 0.88 xong trong vài giây, còn 0.87 mất hơn hai phút." + }, + "replacement": { + "dir": "public/images/blog", + "base": "blog-tablepro-0-88-performance-4" + }, + "status": "supplied", + "src": { + "light": { + "widths": [ + 1408 + ], + "formats": [ + "webp", + "webm", + "mp4" + ], + "width": 1408, + "height": 486 + } + }, + "legacySource": null + }, + "blog-tablepro-0-88-performance-5": { + "kind": "video", + "type": "video", + "family": "blog", + "ownerRepo": "web", + "slot": true, + "handoffPriority": "P3", + "usedOn": [ + { + "path": "/blog/tablepro-0-88-performance", + "section": "figure-5" + } + ], + "aspect": "1408:486", + "priority": false, + "theme": "single", + "locale": "shared", + "mobile": null, + "description": { + "en": "Clip: exporting 200,000 rows to CSV on 0.87.0 and 0.88 beta side by side.", + "vi": "Clip: export 200.000 dòng ra CSV trên 0.87.0 và 0.88 beta đặt cạnh nhau." + }, + "alt": { + "en": "Two TablePro export sheets side by side exporting the events table of 200,000 rows from SQLite to CSV, 0.87.0 on the left and 0.88 beta on the right, where 0.88 beta shows Export completed while 0.87.0 is still counting rows, and then both show Export completed.", + "vi": "Hai sheet export của TablePro đặt cạnh nhau, export bảng events 200.000 dòng từ SQLite ra CSV, 0.87.0 bên trái và 0.88 beta bên phải, trong đó 0.88 beta đã báo Export completed khi 0.87.0 vẫn đang đếm dòng, rồi cả hai cùng báo Export completed." + }, + "caption": { + "en": "0.88 finishes the same 200,000-row export while 0.87 is still writing rows.", + "vi": "0.88 xong cùng một lần export 200.000 dòng trong khi 0.87 vẫn đang ghi." + }, + "replacement": { + "dir": "public/images/blog", + "base": "blog-tablepro-0-88-performance-5" + }, + "status": "supplied", + "src": { + "light": { + "widths": [ + 1408 + ], + "formats": [ + "webp", + "webm", + "mp4" + ], + "width": 1408, + "height": 486 + } + }, + "legacySource": null } } } diff --git a/resources/js/lib/data/asset-locales/de.json b/resources/js/lib/data/asset-locales/de.json index 95b4a7c4..60e44f24 100644 --- a/resources/js/lib/data/asset-locales/de.json +++ b/resources/js/lib/data/asset-locales/de.json @@ -853,5 +853,45 @@ "caption": { "en": "The connection dialog keeps TLS and SSH tunnel settings together." } + }, + "blog-tablepro-0-88-performance-1": { + "alt": { + "en": "A bar chart of six tasks timed on TablePro 0.87.0 in gray and 0.88 beta in orange, from a PostgreSQL dump import at 137.5 s against 8.59 s down to opening a PostgreSQL table at 2,114 ms against 1,287 ms, with the speedup of each row, from 16x to 1.6x, on the right." + }, + "caption": { + "en": "Every task is faster on 0.88, from 1.6 times for opening a PostgreSQL table to 16 times for a dump import." + } + }, + "blog-tablepro-0-88-performance-2": { + "alt": { + "en": "A round-trip diagram of SELECT * FROM orders on MySQL 200 ms away, where 0.87.0 on the left sends SET SQL_SELECT_LIMIT, USE `shop`, SET SQL_SELECT_LIMIT = 10001 and the SELECT one at a time for 4 round trips and 830 ms, and 0.88 beta on the right sends the limit and the SELECT together for 1 round trip and 214 ms." + }, + "caption": { + "en": "Without the USE, the limit and the query share one round trip instead of taking four." + } + }, + "blog-tablepro-0-88-performance-3": { + "alt": { + "en": "Two TablePro windows side by side on the orders table of a MySQL connection named Shop, 0.87.0 on the left and 0.88 beta on the right, each opening the table and paging from page 1 to page 4 of 100, 1,000 rows at a time." + }, + "caption": { + "en": "With one round trip per page instead of two, 0.88 beta gets to each page first." + } + }, + "blog-tablepro-0-88-performance-4": { + "alt": { + "en": "Two TablePro import sheets side by side for src-dump.sql, 59 KB and 642 statements, with Wrap in transaction on, 0.87.0 on the left and 0.88 beta on the right under a timer at 8x speed, where 0.88 beta shows Import completed after 4.39 seconds while 0.87.0 stays at 0 of 642 statements until it completes after 131.97 seconds." + }, + "caption": { + "en": "The same 642-statement dump, 200 ms away: 0.88 finishes in seconds, and 0.87 takes over two minutes." + } + }, + "blog-tablepro-0-88-performance-5": { + "alt": { + "en": "Two TablePro export sheets side by side exporting the events table of 200,000 rows from SQLite to CSV, 0.87.0 on the left and 0.88 beta on the right, where 0.88 beta shows Export completed while 0.87.0 is still counting rows, and then both show Export completed." + }, + "caption": { + "en": "0.88 finishes the same 200,000-row export while 0.87 is still writing rows." + } } } diff --git a/resources/js/lib/data/asset-locales/en.json b/resources/js/lib/data/asset-locales/en.json index f195fc6b..c9ebea42 100644 --- a/resources/js/lib/data/asset-locales/en.json +++ b/resources/js/lib/data/asset-locales/en.json @@ -853,5 +853,45 @@ "caption": { "en": "The connection dialog keeps TLS and SSH tunnel settings together." } + }, + "blog-tablepro-0-88-performance-1": { + "alt": { + "en": "A bar chart of six tasks timed on TablePro 0.87.0 in gray and 0.88 beta in orange, from a PostgreSQL dump import at 137.5 s against 8.59 s down to opening a PostgreSQL table at 2,114 ms against 1,287 ms, with the speedup of each row, from 16x to 1.6x, on the right." + }, + "caption": { + "en": "Every task is faster on 0.88, from 1.6 times for opening a PostgreSQL table to 16 times for a dump import." + } + }, + "blog-tablepro-0-88-performance-2": { + "alt": { + "en": "A round-trip diagram of SELECT * FROM orders on MySQL 200 ms away, where 0.87.0 on the left sends SET SQL_SELECT_LIMIT, USE `shop`, SET SQL_SELECT_LIMIT = 10001 and the SELECT one at a time for 4 round trips and 830 ms, and 0.88 beta on the right sends the limit and the SELECT together for 1 round trip and 214 ms." + }, + "caption": { + "en": "Without the USE, the limit and the query share one round trip instead of taking four." + } + }, + "blog-tablepro-0-88-performance-3": { + "alt": { + "en": "Two TablePro windows side by side on the orders table of a MySQL connection named Shop, 0.87.0 on the left and 0.88 beta on the right, each opening the table and paging from page 1 to page 4 of 100, 1,000 rows at a time." + }, + "caption": { + "en": "With one round trip per page instead of two, 0.88 beta gets to each page first." + } + }, + "blog-tablepro-0-88-performance-4": { + "alt": { + "en": "Two TablePro import sheets side by side for src-dump.sql, 59 KB and 642 statements, with Wrap in transaction on, 0.87.0 on the left and 0.88 beta on the right under a timer at 8x speed, where 0.88 beta shows Import completed after 4.39 seconds while 0.87.0 stays at 0 of 642 statements until it completes after 131.97 seconds." + }, + "caption": { + "en": "The same 642-statement dump, 200 ms away: 0.88 finishes in seconds, and 0.87 takes over two minutes." + } + }, + "blog-tablepro-0-88-performance-5": { + "alt": { + "en": "Two TablePro export sheets side by side exporting the events table of 200,000 rows from SQLite to CSV, 0.87.0 on the left and 0.88 beta on the right, where 0.88 beta shows Export completed while 0.87.0 is still counting rows, and then both show Export completed." + }, + "caption": { + "en": "0.88 finishes the same 200,000-row export while 0.87 is still writing rows." + } } } diff --git a/resources/js/lib/data/asset-locales/es.json b/resources/js/lib/data/asset-locales/es.json index 9d4541ac..6f56496f 100644 --- a/resources/js/lib/data/asset-locales/es.json +++ b/resources/js/lib/data/asset-locales/es.json @@ -853,5 +853,45 @@ "caption": { "en": "The connection dialog keeps TLS and SSH tunnel settings together." } + }, + "blog-tablepro-0-88-performance-1": { + "alt": { + "en": "A bar chart of six tasks timed on TablePro 0.87.0 in gray and 0.88 beta in orange, from a PostgreSQL dump import at 137.5 s against 8.59 s down to opening a PostgreSQL table at 2,114 ms against 1,287 ms, with the speedup of each row, from 16x to 1.6x, on the right." + }, + "caption": { + "en": "Every task is faster on 0.88, from 1.6 times for opening a PostgreSQL table to 16 times for a dump import." + } + }, + "blog-tablepro-0-88-performance-2": { + "alt": { + "en": "A round-trip diagram of SELECT * FROM orders on MySQL 200 ms away, where 0.87.0 on the left sends SET SQL_SELECT_LIMIT, USE `shop`, SET SQL_SELECT_LIMIT = 10001 and the SELECT one at a time for 4 round trips and 830 ms, and 0.88 beta on the right sends the limit and the SELECT together for 1 round trip and 214 ms." + }, + "caption": { + "en": "Without the USE, the limit and the query share one round trip instead of taking four." + } + }, + "blog-tablepro-0-88-performance-3": { + "alt": { + "en": "Two TablePro windows side by side on the orders table of a MySQL connection named Shop, 0.87.0 on the left and 0.88 beta on the right, each opening the table and paging from page 1 to page 4 of 100, 1,000 rows at a time." + }, + "caption": { + "en": "With one round trip per page instead of two, 0.88 beta gets to each page first." + } + }, + "blog-tablepro-0-88-performance-4": { + "alt": { + "en": "Two TablePro import sheets side by side for src-dump.sql, 59 KB and 642 statements, with Wrap in transaction on, 0.87.0 on the left and 0.88 beta on the right under a timer at 8x speed, where 0.88 beta shows Import completed after 4.39 seconds while 0.87.0 stays at 0 of 642 statements until it completes after 131.97 seconds." + }, + "caption": { + "en": "The same 642-statement dump, 200 ms away: 0.88 finishes in seconds, and 0.87 takes over two minutes." + } + }, + "blog-tablepro-0-88-performance-5": { + "alt": { + "en": "Two TablePro export sheets side by side exporting the events table of 200,000 rows from SQLite to CSV, 0.87.0 on the left and 0.88 beta on the right, where 0.88 beta shows Export completed while 0.87.0 is still counting rows, and then both show Export completed." + }, + "caption": { + "en": "0.88 finishes the same 200,000-row export while 0.87 is still writing rows." + } } } diff --git a/resources/js/lib/data/asset-locales/fr.json b/resources/js/lib/data/asset-locales/fr.json index cd451985..72b38f17 100644 --- a/resources/js/lib/data/asset-locales/fr.json +++ b/resources/js/lib/data/asset-locales/fr.json @@ -853,5 +853,45 @@ "caption": { "en": "The connection dialog keeps TLS and SSH tunnel settings together." } + }, + "blog-tablepro-0-88-performance-1": { + "alt": { + "en": "A bar chart of six tasks timed on TablePro 0.87.0 in gray and 0.88 beta in orange, from a PostgreSQL dump import at 137.5 s against 8.59 s down to opening a PostgreSQL table at 2,114 ms against 1,287 ms, with the speedup of each row, from 16x to 1.6x, on the right." + }, + "caption": { + "en": "Every task is faster on 0.88, from 1.6 times for opening a PostgreSQL table to 16 times for a dump import." + } + }, + "blog-tablepro-0-88-performance-2": { + "alt": { + "en": "A round-trip diagram of SELECT * FROM orders on MySQL 200 ms away, where 0.87.0 on the left sends SET SQL_SELECT_LIMIT, USE `shop`, SET SQL_SELECT_LIMIT = 10001 and the SELECT one at a time for 4 round trips and 830 ms, and 0.88 beta on the right sends the limit and the SELECT together for 1 round trip and 214 ms." + }, + "caption": { + "en": "Without the USE, the limit and the query share one round trip instead of taking four." + } + }, + "blog-tablepro-0-88-performance-3": { + "alt": { + "en": "Two TablePro windows side by side on the orders table of a MySQL connection named Shop, 0.87.0 on the left and 0.88 beta on the right, each opening the table and paging from page 1 to page 4 of 100, 1,000 rows at a time." + }, + "caption": { + "en": "With one round trip per page instead of two, 0.88 beta gets to each page first." + } + }, + "blog-tablepro-0-88-performance-4": { + "alt": { + "en": "Two TablePro import sheets side by side for src-dump.sql, 59 KB and 642 statements, with Wrap in transaction on, 0.87.0 on the left and 0.88 beta on the right under a timer at 8x speed, where 0.88 beta shows Import completed after 4.39 seconds while 0.87.0 stays at 0 of 642 statements until it completes after 131.97 seconds." + }, + "caption": { + "en": "The same 642-statement dump, 200 ms away: 0.88 finishes in seconds, and 0.87 takes over two minutes." + } + }, + "blog-tablepro-0-88-performance-5": { + "alt": { + "en": "Two TablePro export sheets side by side exporting the events table of 200,000 rows from SQLite to CSV, 0.87.0 on the left and 0.88 beta on the right, where 0.88 beta shows Export completed while 0.87.0 is still counting rows, and then both show Export completed." + }, + "caption": { + "en": "0.88 finishes the same 200,000-row export while 0.87 is still writing rows." + } } } diff --git a/resources/js/lib/data/asset-locales/id.json b/resources/js/lib/data/asset-locales/id.json index d3f88eb1..fbdf06c2 100644 --- a/resources/js/lib/data/asset-locales/id.json +++ b/resources/js/lib/data/asset-locales/id.json @@ -853,5 +853,45 @@ "caption": { "en": "The connection dialog keeps TLS and SSH tunnel settings together." } + }, + "blog-tablepro-0-88-performance-1": { + "alt": { + "en": "A bar chart of six tasks timed on TablePro 0.87.0 in gray and 0.88 beta in orange, from a PostgreSQL dump import at 137.5 s against 8.59 s down to opening a PostgreSQL table at 2,114 ms against 1,287 ms, with the speedup of each row, from 16x to 1.6x, on the right." + }, + "caption": { + "en": "Every task is faster on 0.88, from 1.6 times for opening a PostgreSQL table to 16 times for a dump import." + } + }, + "blog-tablepro-0-88-performance-2": { + "alt": { + "en": "A round-trip diagram of SELECT * FROM orders on MySQL 200 ms away, where 0.87.0 on the left sends SET SQL_SELECT_LIMIT, USE `shop`, SET SQL_SELECT_LIMIT = 10001 and the SELECT one at a time for 4 round trips and 830 ms, and 0.88 beta on the right sends the limit and the SELECT together for 1 round trip and 214 ms." + }, + "caption": { + "en": "Without the USE, the limit and the query share one round trip instead of taking four." + } + }, + "blog-tablepro-0-88-performance-3": { + "alt": { + "en": "Two TablePro windows side by side on the orders table of a MySQL connection named Shop, 0.87.0 on the left and 0.88 beta on the right, each opening the table and paging from page 1 to page 4 of 100, 1,000 rows at a time." + }, + "caption": { + "en": "With one round trip per page instead of two, 0.88 beta gets to each page first." + } + }, + "blog-tablepro-0-88-performance-4": { + "alt": { + "en": "Two TablePro import sheets side by side for src-dump.sql, 59 KB and 642 statements, with Wrap in transaction on, 0.87.0 on the left and 0.88 beta on the right under a timer at 8x speed, where 0.88 beta shows Import completed after 4.39 seconds while 0.87.0 stays at 0 of 642 statements until it completes after 131.97 seconds." + }, + "caption": { + "en": "The same 642-statement dump, 200 ms away: 0.88 finishes in seconds, and 0.87 takes over two minutes." + } + }, + "blog-tablepro-0-88-performance-5": { + "alt": { + "en": "Two TablePro export sheets side by side exporting the events table of 200,000 rows from SQLite to CSV, 0.87.0 on the left and 0.88 beta on the right, where 0.88 beta shows Export completed while 0.87.0 is still counting rows, and then both show Export completed." + }, + "caption": { + "en": "0.88 finishes the same 200,000-row export while 0.87 is still writing rows." + } } } diff --git a/resources/js/lib/data/asset-locales/it.json b/resources/js/lib/data/asset-locales/it.json index 01c046e1..eeff21e6 100644 --- a/resources/js/lib/data/asset-locales/it.json +++ b/resources/js/lib/data/asset-locales/it.json @@ -853,5 +853,45 @@ "caption": { "en": "The connection dialog keeps TLS and SSH tunnel settings together." } + }, + "blog-tablepro-0-88-performance-1": { + "alt": { + "en": "A bar chart of six tasks timed on TablePro 0.87.0 in gray and 0.88 beta in orange, from a PostgreSQL dump import at 137.5 s against 8.59 s down to opening a PostgreSQL table at 2,114 ms against 1,287 ms, with the speedup of each row, from 16x to 1.6x, on the right." + }, + "caption": { + "en": "Every task is faster on 0.88, from 1.6 times for opening a PostgreSQL table to 16 times for a dump import." + } + }, + "blog-tablepro-0-88-performance-2": { + "alt": { + "en": "A round-trip diagram of SELECT * FROM orders on MySQL 200 ms away, where 0.87.0 on the left sends SET SQL_SELECT_LIMIT, USE `shop`, SET SQL_SELECT_LIMIT = 10001 and the SELECT one at a time for 4 round trips and 830 ms, and 0.88 beta on the right sends the limit and the SELECT together for 1 round trip and 214 ms." + }, + "caption": { + "en": "Without the USE, the limit and the query share one round trip instead of taking four." + } + }, + "blog-tablepro-0-88-performance-3": { + "alt": { + "en": "Two TablePro windows side by side on the orders table of a MySQL connection named Shop, 0.87.0 on the left and 0.88 beta on the right, each opening the table and paging from page 1 to page 4 of 100, 1,000 rows at a time." + }, + "caption": { + "en": "With one round trip per page instead of two, 0.88 beta gets to each page first." + } + }, + "blog-tablepro-0-88-performance-4": { + "alt": { + "en": "Two TablePro import sheets side by side for src-dump.sql, 59 KB and 642 statements, with Wrap in transaction on, 0.87.0 on the left and 0.88 beta on the right under a timer at 8x speed, where 0.88 beta shows Import completed after 4.39 seconds while 0.87.0 stays at 0 of 642 statements until it completes after 131.97 seconds." + }, + "caption": { + "en": "The same 642-statement dump, 200 ms away: 0.88 finishes in seconds, and 0.87 takes over two minutes." + } + }, + "blog-tablepro-0-88-performance-5": { + "alt": { + "en": "Two TablePro export sheets side by side exporting the events table of 200,000 rows from SQLite to CSV, 0.87.0 on the left and 0.88 beta on the right, where 0.88 beta shows Export completed while 0.87.0 is still counting rows, and then both show Export completed." + }, + "caption": { + "en": "0.88 finishes the same 200,000-row export while 0.87 is still writing rows." + } } } diff --git a/resources/js/lib/data/asset-locales/ja.json b/resources/js/lib/data/asset-locales/ja.json index 075d99de..ec9b144e 100644 --- a/resources/js/lib/data/asset-locales/ja.json +++ b/resources/js/lib/data/asset-locales/ja.json @@ -853,5 +853,45 @@ "caption": { "en": "The connection dialog keeps TLS and SSH tunnel settings together." } + }, + "blog-tablepro-0-88-performance-1": { + "alt": { + "en": "A bar chart of six tasks timed on TablePro 0.87.0 in gray and 0.88 beta in orange, from a PostgreSQL dump import at 137.5 s against 8.59 s down to opening a PostgreSQL table at 2,114 ms against 1,287 ms, with the speedup of each row, from 16x to 1.6x, on the right." + }, + "caption": { + "en": "Every task is faster on 0.88, from 1.6 times for opening a PostgreSQL table to 16 times for a dump import." + } + }, + "blog-tablepro-0-88-performance-2": { + "alt": { + "en": "A round-trip diagram of SELECT * FROM orders on MySQL 200 ms away, where 0.87.0 on the left sends SET SQL_SELECT_LIMIT, USE `shop`, SET SQL_SELECT_LIMIT = 10001 and the SELECT one at a time for 4 round trips and 830 ms, and 0.88 beta on the right sends the limit and the SELECT together for 1 round trip and 214 ms." + }, + "caption": { + "en": "Without the USE, the limit and the query share one round trip instead of taking four." + } + }, + "blog-tablepro-0-88-performance-3": { + "alt": { + "en": "Two TablePro windows side by side on the orders table of a MySQL connection named Shop, 0.87.0 on the left and 0.88 beta on the right, each opening the table and paging from page 1 to page 4 of 100, 1,000 rows at a time." + }, + "caption": { + "en": "With one round trip per page instead of two, 0.88 beta gets to each page first." + } + }, + "blog-tablepro-0-88-performance-4": { + "alt": { + "en": "Two TablePro import sheets side by side for src-dump.sql, 59 KB and 642 statements, with Wrap in transaction on, 0.87.0 on the left and 0.88 beta on the right under a timer at 8x speed, where 0.88 beta shows Import completed after 4.39 seconds while 0.87.0 stays at 0 of 642 statements until it completes after 131.97 seconds." + }, + "caption": { + "en": "The same 642-statement dump, 200 ms away: 0.88 finishes in seconds, and 0.87 takes over two minutes." + } + }, + "blog-tablepro-0-88-performance-5": { + "alt": { + "en": "Two TablePro export sheets side by side exporting the events table of 200,000 rows from SQLite to CSV, 0.87.0 on the left and 0.88 beta on the right, where 0.88 beta shows Export completed while 0.87.0 is still counting rows, and then both show Export completed." + }, + "caption": { + "en": "0.88 finishes the same 200,000-row export while 0.87 is still writing rows." + } } } diff --git a/resources/js/lib/data/asset-locales/ko.json b/resources/js/lib/data/asset-locales/ko.json index 5db1f450..bb9e47fb 100644 --- a/resources/js/lib/data/asset-locales/ko.json +++ b/resources/js/lib/data/asset-locales/ko.json @@ -853,5 +853,45 @@ "caption": { "en": "The connection dialog keeps TLS and SSH tunnel settings together." } + }, + "blog-tablepro-0-88-performance-1": { + "alt": { + "en": "A bar chart of six tasks timed on TablePro 0.87.0 in gray and 0.88 beta in orange, from a PostgreSQL dump import at 137.5 s against 8.59 s down to opening a PostgreSQL table at 2,114 ms against 1,287 ms, with the speedup of each row, from 16x to 1.6x, on the right." + }, + "caption": { + "en": "Every task is faster on 0.88, from 1.6 times for opening a PostgreSQL table to 16 times for a dump import." + } + }, + "blog-tablepro-0-88-performance-2": { + "alt": { + "en": "A round-trip diagram of SELECT * FROM orders on MySQL 200 ms away, where 0.87.0 on the left sends SET SQL_SELECT_LIMIT, USE `shop`, SET SQL_SELECT_LIMIT = 10001 and the SELECT one at a time for 4 round trips and 830 ms, and 0.88 beta on the right sends the limit and the SELECT together for 1 round trip and 214 ms." + }, + "caption": { + "en": "Without the USE, the limit and the query share one round trip instead of taking four." + } + }, + "blog-tablepro-0-88-performance-3": { + "alt": { + "en": "Two TablePro windows side by side on the orders table of a MySQL connection named Shop, 0.87.0 on the left and 0.88 beta on the right, each opening the table and paging from page 1 to page 4 of 100, 1,000 rows at a time." + }, + "caption": { + "en": "With one round trip per page instead of two, 0.88 beta gets to each page first." + } + }, + "blog-tablepro-0-88-performance-4": { + "alt": { + "en": "Two TablePro import sheets side by side for src-dump.sql, 59 KB and 642 statements, with Wrap in transaction on, 0.87.0 on the left and 0.88 beta on the right under a timer at 8x speed, where 0.88 beta shows Import completed after 4.39 seconds while 0.87.0 stays at 0 of 642 statements until it completes after 131.97 seconds." + }, + "caption": { + "en": "The same 642-statement dump, 200 ms away: 0.88 finishes in seconds, and 0.87 takes over two minutes." + } + }, + "blog-tablepro-0-88-performance-5": { + "alt": { + "en": "Two TablePro export sheets side by side exporting the events table of 200,000 rows from SQLite to CSV, 0.87.0 on the left and 0.88 beta on the right, where 0.88 beta shows Export completed while 0.87.0 is still counting rows, and then both show Export completed." + }, + "caption": { + "en": "0.88 finishes the same 200,000-row export while 0.87 is still writing rows." + } } } diff --git a/resources/js/lib/data/asset-locales/pt-BR.json b/resources/js/lib/data/asset-locales/pt-BR.json index 78d406ed..4c5bee85 100644 --- a/resources/js/lib/data/asset-locales/pt-BR.json +++ b/resources/js/lib/data/asset-locales/pt-BR.json @@ -853,5 +853,45 @@ "caption": { "en": "The connection dialog keeps TLS and SSH tunnel settings together." } + }, + "blog-tablepro-0-88-performance-1": { + "alt": { + "en": "A bar chart of six tasks timed on TablePro 0.87.0 in gray and 0.88 beta in orange, from a PostgreSQL dump import at 137.5 s against 8.59 s down to opening a PostgreSQL table at 2,114 ms against 1,287 ms, with the speedup of each row, from 16x to 1.6x, on the right." + }, + "caption": { + "en": "Every task is faster on 0.88, from 1.6 times for opening a PostgreSQL table to 16 times for a dump import." + } + }, + "blog-tablepro-0-88-performance-2": { + "alt": { + "en": "A round-trip diagram of SELECT * FROM orders on MySQL 200 ms away, where 0.87.0 on the left sends SET SQL_SELECT_LIMIT, USE `shop`, SET SQL_SELECT_LIMIT = 10001 and the SELECT one at a time for 4 round trips and 830 ms, and 0.88 beta on the right sends the limit and the SELECT together for 1 round trip and 214 ms." + }, + "caption": { + "en": "Without the USE, the limit and the query share one round trip instead of taking four." + } + }, + "blog-tablepro-0-88-performance-3": { + "alt": { + "en": "Two TablePro windows side by side on the orders table of a MySQL connection named Shop, 0.87.0 on the left and 0.88 beta on the right, each opening the table and paging from page 1 to page 4 of 100, 1,000 rows at a time." + }, + "caption": { + "en": "With one round trip per page instead of two, 0.88 beta gets to each page first." + } + }, + "blog-tablepro-0-88-performance-4": { + "alt": { + "en": "Two TablePro import sheets side by side for src-dump.sql, 59 KB and 642 statements, with Wrap in transaction on, 0.87.0 on the left and 0.88 beta on the right under a timer at 8x speed, where 0.88 beta shows Import completed after 4.39 seconds while 0.87.0 stays at 0 of 642 statements until it completes after 131.97 seconds." + }, + "caption": { + "en": "The same 642-statement dump, 200 ms away: 0.88 finishes in seconds, and 0.87 takes over two minutes." + } + }, + "blog-tablepro-0-88-performance-5": { + "alt": { + "en": "Two TablePro export sheets side by side exporting the events table of 200,000 rows from SQLite to CSV, 0.87.0 on the left and 0.88 beta on the right, where 0.88 beta shows Export completed while 0.87.0 is still counting rows, and then both show Export completed." + }, + "caption": { + "en": "0.88 finishes the same 200,000-row export while 0.87 is still writing rows." + } } } diff --git a/resources/js/lib/data/asset-locales/vi.json b/resources/js/lib/data/asset-locales/vi.json index 311b77e0..18232ba7 100644 --- a/resources/js/lib/data/asset-locales/vi.json +++ b/resources/js/lib/data/asset-locales/vi.json @@ -853,5 +853,45 @@ "caption": { "en": "The connection dialog keeps TLS and SSH tunnel settings together." } + }, + "blog-tablepro-0-88-performance-1": { + "alt": { + "vi": "Biểu đồ cột sáu thao tác đo trên TablePro 0.87.0 màu xám và 0.88 beta màu cam, từ import một bản dump PostgreSQL, 137.5 s so với 8.59 s, tới mở một bảng PostgreSQL, 2114 ms so với 1287 ms, với mức nhanh hơn của từng dòng, từ 16x tới 1.6x, ở bên phải." + }, + "caption": { + "vi": "Thao tác nào cũng nhanh hơn trên 0.88, từ 1.6 lần khi mở một bảng PostgreSQL tới 16 lần khi import dump." + } + }, + "blog-tablepro-0-88-performance-2": { + "alt": { + "vi": "Sơ đồ lượt đi về của SELECT * FROM orders trên MySQL ở xa 200 ms, trong đó 0.87.0 bên trái gửi lần lượt SET SQL_SELECT_LIMIT, USE `shop`, SET SQL_SELECT_LIMIT = 10001 rồi câu SELECT, tốn 4 lượt và 830 ms, còn 0.88 beta bên phải gửi giới hạn và câu SELECT cùng lúc, 1 lượt và 214 ms." + }, + "caption": { + "vi": "Không còn USE, giới hạn và query đi chung một lượt thay vì bốn lượt." + } + }, + "blog-tablepro-0-88-performance-3": { + "alt": { + "vi": "Hai cửa sổ TablePro đặt cạnh nhau trên bảng orders của connection MySQL tên Shop, 0.87.0 bên trái và 0.88 beta bên phải, mỗi bên mở bảng rồi sang từ trang 1 tới trang 4 trên 100, mỗi trang 1.000 dòng." + }, + "caption": { + "vi": "Mỗi lần sang trang chỉ còn một lượt đi về thay vì hai, nên 0.88 beta tới mỗi trang trước." + } + }, + "blog-tablepro-0-88-performance-4": { + "alt": { + "vi": "Hai sheet import của TablePro đặt cạnh nhau cho file src-dump.sql, 59 KB và 642 câu lệnh, với Wrap in transaction đang bật, 0.87.0 bên trái và 0.88 beta bên phải dưới một đồng hồ tua nhanh 8x, trong đó 0.88 beta báo Import completed sau 4.39 giây còn 0.87.0 đứng ở 0 of 642 statements cho tới khi xong sau 131.97 giây." + }, + "caption": { + "vi": "Cùng một bản dump 642 câu lệnh, ở xa 200 ms: 0.88 xong trong vài giây, còn 0.87 mất hơn hai phút." + } + }, + "blog-tablepro-0-88-performance-5": { + "alt": { + "vi": "Hai sheet export của TablePro đặt cạnh nhau, export bảng events 200.000 dòng từ SQLite ra CSV, 0.87.0 bên trái và 0.88 beta bên phải, trong đó 0.88 beta đã báo Export completed khi 0.87.0 vẫn đang đếm dòng, rồi cả hai cùng báo Export completed." + }, + "caption": { + "vi": "0.88 xong cùng một lần export 200.000 dòng trong khi 0.87 vẫn đang ghi." + } } } diff --git a/resources/js/lib/data/asset-locales/zh-Hans.json b/resources/js/lib/data/asset-locales/zh-Hans.json index 98dffd81..e55c524f 100644 --- a/resources/js/lib/data/asset-locales/zh-Hans.json +++ b/resources/js/lib/data/asset-locales/zh-Hans.json @@ -853,5 +853,45 @@ "caption": { "en": "The connection dialog keeps TLS and SSH tunnel settings together." } + }, + "blog-tablepro-0-88-performance-1": { + "alt": { + "en": "A bar chart of six tasks timed on TablePro 0.87.0 in gray and 0.88 beta in orange, from a PostgreSQL dump import at 137.5 s against 8.59 s down to opening a PostgreSQL table at 2,114 ms against 1,287 ms, with the speedup of each row, from 16x to 1.6x, on the right." + }, + "caption": { + "en": "Every task is faster on 0.88, from 1.6 times for opening a PostgreSQL table to 16 times for a dump import." + } + }, + "blog-tablepro-0-88-performance-2": { + "alt": { + "en": "A round-trip diagram of SELECT * FROM orders on MySQL 200 ms away, where 0.87.0 on the left sends SET SQL_SELECT_LIMIT, USE `shop`, SET SQL_SELECT_LIMIT = 10001 and the SELECT one at a time for 4 round trips and 830 ms, and 0.88 beta on the right sends the limit and the SELECT together for 1 round trip and 214 ms." + }, + "caption": { + "en": "Without the USE, the limit and the query share one round trip instead of taking four." + } + }, + "blog-tablepro-0-88-performance-3": { + "alt": { + "en": "Two TablePro windows side by side on the orders table of a MySQL connection named Shop, 0.87.0 on the left and 0.88 beta on the right, each opening the table and paging from page 1 to page 4 of 100, 1,000 rows at a time." + }, + "caption": { + "en": "With one round trip per page instead of two, 0.88 beta gets to each page first." + } + }, + "blog-tablepro-0-88-performance-4": { + "alt": { + "en": "Two TablePro import sheets side by side for src-dump.sql, 59 KB and 642 statements, with Wrap in transaction on, 0.87.0 on the left and 0.88 beta on the right under a timer at 8x speed, where 0.88 beta shows Import completed after 4.39 seconds while 0.87.0 stays at 0 of 642 statements until it completes after 131.97 seconds." + }, + "caption": { + "en": "The same 642-statement dump, 200 ms away: 0.88 finishes in seconds, and 0.87 takes over two minutes." + } + }, + "blog-tablepro-0-88-performance-5": { + "alt": { + "en": "Two TablePro export sheets side by side exporting the events table of 200,000 rows from SQLite to CSV, 0.87.0 on the left and 0.88 beta on the right, where 0.88 beta shows Export completed while 0.87.0 is still counting rows, and then both show Export completed." + }, + "caption": { + "en": "0.88 finishes the same 200,000-row export while 0.87 is still writing rows." + } } } diff --git a/resources/js/lib/data/asset-locales/zh-Hant.json b/resources/js/lib/data/asset-locales/zh-Hant.json index 98b91faa..7adf357e 100644 --- a/resources/js/lib/data/asset-locales/zh-Hant.json +++ b/resources/js/lib/data/asset-locales/zh-Hant.json @@ -853,5 +853,45 @@ "caption": { "en": "The connection dialog keeps TLS and SSH tunnel settings together." } + }, + "blog-tablepro-0-88-performance-1": { + "alt": { + "en": "A bar chart of six tasks timed on TablePro 0.87.0 in gray and 0.88 beta in orange, from a PostgreSQL dump import at 137.5 s against 8.59 s down to opening a PostgreSQL table at 2,114 ms against 1,287 ms, with the speedup of each row, from 16x to 1.6x, on the right." + }, + "caption": { + "en": "Every task is faster on 0.88, from 1.6 times for opening a PostgreSQL table to 16 times for a dump import." + } + }, + "blog-tablepro-0-88-performance-2": { + "alt": { + "en": "A round-trip diagram of SELECT * FROM orders on MySQL 200 ms away, where 0.87.0 on the left sends SET SQL_SELECT_LIMIT, USE `shop`, SET SQL_SELECT_LIMIT = 10001 and the SELECT one at a time for 4 round trips and 830 ms, and 0.88 beta on the right sends the limit and the SELECT together for 1 round trip and 214 ms." + }, + "caption": { + "en": "Without the USE, the limit and the query share one round trip instead of taking four." + } + }, + "blog-tablepro-0-88-performance-3": { + "alt": { + "en": "Two TablePro windows side by side on the orders table of a MySQL connection named Shop, 0.87.0 on the left and 0.88 beta on the right, each opening the table and paging from page 1 to page 4 of 100, 1,000 rows at a time." + }, + "caption": { + "en": "With one round trip per page instead of two, 0.88 beta gets to each page first." + } + }, + "blog-tablepro-0-88-performance-4": { + "alt": { + "en": "Two TablePro import sheets side by side for src-dump.sql, 59 KB and 642 statements, with Wrap in transaction on, 0.87.0 on the left and 0.88 beta on the right under a timer at 8x speed, where 0.88 beta shows Import completed after 4.39 seconds while 0.87.0 stays at 0 of 642 statements until it completes after 131.97 seconds." + }, + "caption": { + "en": "The same 642-statement dump, 200 ms away: 0.88 finishes in seconds, and 0.87 takes over two minutes." + } + }, + "blog-tablepro-0-88-performance-5": { + "alt": { + "en": "Two TablePro export sheets side by side exporting the events table of 200,000 rows from SQLite to CSV, 0.87.0 on the left and 0.88 beta on the right, where 0.88 beta shows Export completed while 0.87.0 is still counting rows, and then both show Export completed." + }, + "caption": { + "en": "0.88 finishes the same 200,000-row export while 0.87 is still writing rows." + } } } diff --git a/resources/js/lib/data/asset-slots.json b/resources/js/lib/data/asset-slots.json index 858fa9b9..0a63debd 100644 --- a/resources/js/lib/data/asset-slots.json +++ b/resources/js/lib/data/asset-slots.json @@ -4678,6 +4678,231 @@ "dir": "public/images/blog", "base": "blog-tablepro-for-linux-beta-4" } + }, + "blog-tablepro-0-88-performance-1": { + "kind": "figure", + "type": "detail", + "slot": true, + "aspect": "1216:928", + "priority": false, + "theme": "both", + "locale": "per-locale", + "mobile": null, + "status": "supplied", + "src": { + "en": { + "light": { + "widths": [ + 704, + 1408 + ], + "formats": [ + "avif", + "webp" + ], + "width": 1408, + "height": 1075 + }, + "dark": { + "widths": [ + 704, + 1408 + ], + "formats": [ + "avif", + "webp" + ], + "width": 1408, + "height": 1075 + } + }, + "vi": { + "light": { + "widths": [ + 704, + 1408 + ], + "formats": [ + "avif", + "webp" + ], + "width": 1408, + "height": 1075 + }, + "dark": { + "widths": [ + 704, + 1408 + ], + "formats": [ + "avif", + "webp" + ], + "width": 1408, + "height": 1075 + } + } + }, + "replacement": { + "dir": "public/images/blog", + "base": "blog-tablepro-0-88-performance-1" + } + }, + "blog-tablepro-0-88-performance-2": { + "kind": "figure", + "type": "detail", + "slot": true, + "aspect": "1216:684", + "priority": false, + "theme": "both", + "locale": "per-locale", + "mobile": null, + "status": "supplied", + "src": { + "en": { + "light": { + "widths": [ + 704, + 1408 + ], + "formats": [ + "avif", + "webp" + ], + "width": 1408, + "height": 792 + }, + "dark": { + "widths": [ + 704, + 1408 + ], + "formats": [ + "avif", + "webp" + ], + "width": 1408, + "height": 792 + } + }, + "vi": { + "light": { + "widths": [ + 704, + 1408 + ], + "formats": [ + "avif", + "webp" + ], + "width": 1408, + "height": 792 + }, + "dark": { + "widths": [ + 704, + 1408 + ], + "formats": [ + "avif", + "webp" + ], + "width": 1408, + "height": 792 + } + } + }, + "replacement": { + "dir": "public/images/blog", + "base": "blog-tablepro-0-88-performance-2" + } + }, + "blog-tablepro-0-88-performance-3": { + "kind": "video", + "type": "video", + "slot": true, + "aspect": "1408:486", + "priority": false, + "theme": "single", + "locale": "shared", + "mobile": null, + "status": "supplied", + "src": { + "light": { + "widths": [ + 1408 + ], + "formats": [ + "webp", + "webm", + "mp4" + ], + "width": 1408, + "height": 486 + } + }, + "replacement": { + "dir": "public/images/blog", + "base": "blog-tablepro-0-88-performance-3" + } + }, + "blog-tablepro-0-88-performance-4": { + "kind": "video", + "type": "video", + "slot": true, + "aspect": "1408:486", + "priority": false, + "theme": "single", + "locale": "shared", + "mobile": null, + "status": "supplied", + "src": { + "light": { + "widths": [ + 1408 + ], + "formats": [ + "webp", + "webm", + "mp4" + ], + "width": 1408, + "height": 486 + } + }, + "replacement": { + "dir": "public/images/blog", + "base": "blog-tablepro-0-88-performance-4" + } + }, + "blog-tablepro-0-88-performance-5": { + "kind": "video", + "type": "video", + "slot": true, + "aspect": "1408:486", + "priority": false, + "theme": "single", + "locale": "shared", + "mobile": null, + "status": "supplied", + "src": { + "light": { + "widths": [ + 1408 + ], + "formats": [ + "webp", + "webm", + "mp4" + ], + "width": 1408, + "height": 486 + } + }, + "replacement": { + "dir": "public/images/blog", + "base": "blog-tablepro-0-88-performance-5" + } } } } diff --git a/tests/Feature/Assets/AssetManifestTest.php b/tests/Feature/Assets/AssetManifestTest.php index 7f1456e3..f5686d45 100644 --- a/tests/Feature/Assets/AssetManifestTest.php +++ b/tests/Feature/Assets/AssetManifestTest.php @@ -114,6 +114,24 @@ function assetSuppliedFixture(string $root, ?callable $mutate = null): AssetMani return new AssetManifest($path, $root); } +// fixture-diagram as a figure in a post written in English and Vietnamese only. +function assetPostDiagram(array $data): array +{ + $entry = $data['assets']['fixture-diagram']; + $entry['usedOn'] = [['path' => '/blog/tablepro-0-77', 'section' => 'figure-1']]; + + foreach (['description', 'alt'] as $field) { + $entry[$field] = array_map(fn(?string $text): ?string => null, $entry[$field]); + $entry[$field]['en'] = $data['assets']['fixture-diagram'][$field]['en']; + $entry[$field]['vi'] = $data['assets']['fixture-diagram'][$field]['vi']; + } + + $entry['src'] = ['en' => $entry['src']['en'], 'vi' => $entry['src']['vi']]; + $data['assets']['fixture-diagram'] = $entry; + + return $data; +} + function assetInstallFiles(AssetManifest $manifest): void { foreach (array_keys($manifest->assets()) as $id) { @@ -281,6 +299,22 @@ function assetSlotFamilies(): array } })->with('locales'); + it('shows every slot of a translated post in the post’s language', function (): void { + $manifest = new AssetManifest(); + + foreach (assetReferences() as $id => $paths) { + foreach ($paths as $path) { + if (preg_match('#^resources/blog/([A-Za-z-]+)/#', $path, $match) !== 1) { + continue; + } + + foreach ($manifest->slotTextProjection($match[1])[$id] as $field => $text) { + Assert::assertTrue($text === null || array_keys($text) === [$match[1]], "{$id} shows its {$field} in another language in {$path}"); + } + } + } + }); + it('places every entry on a page the site serves', function (): void { $routes = Route::getRoutes(); @@ -451,6 +485,16 @@ function assetSlotFamilies(): array expect($manifest->problems())->toBe([]); }); + it('needs a blog figure only in the languages its text is written in, and shows English in the others', function (): void { + $root = assetScratchDirectory(); + assetInstalledFixture($root); + $manifest = assetSuppliedFixture($root, fn(array $data): array => assetPostDiagram($data)); + + expect($manifest->problems())->toBe([]) + ->and($manifest->slotTextProjection('vi')['fixture-diagram'])->toBe(['alt' => ['vi' => 'Một sơ đồ mẫu'], 'caption' => null]) + ->and($manifest->slotTextProjection('de')['fixture-diagram'])->toBe(['alt' => ['en' => 'A fixture diagram'], 'caption' => null]); + }); + it('names files the way the page renders them', function (): void { $manifest = new AssetManifest(assetFixturePath()); @@ -528,6 +572,15 @@ function (string $root): AssetManifest { }), 'fixture-diagram is per-locale but has no vi sources.', ], + 'a blog figure without the files of a language it is written in' => [ + fn(string $root): AssetManifest => assetSuppliedFixture($root, function (array $data): array { + $data = assetPostDiagram($data); + unset($data['assets']['fixture-diagram']['src']['vi']); + + return $data; + }), + 'fixture-diagram is per-locale but has no vi sources.', + ], 'widths that stop short of the width' => [ fn(string $root): AssetManifest => assetSuppliedFixture($root, function (array $data): array { $data['assets']['fixture-detail']['src']['light']['widths'] = [24]; diff --git a/tests/js/asset-slot.test.ts b/tests/js/asset-slot.test.ts index cdbc9267..4a39e6b1 100644 --- a/tests/js/asset-slot.test.ts +++ b/tests/js/asset-slot.test.ts @@ -30,7 +30,7 @@ function html(manifest: SlotManifestData, id: string, locale = 'en', extra: { si return renderToStaticMarkup(renderAssetSlot(manifest, id, { locale, labels: labels[locale], ...extra })); } -test('every real slot renders as a labelled placeholder that requests nothing, or as a picture once supplied', () => { +test('every real slot renders as a labelled placeholder that requests nothing, or as a picture or a video once supplied', () => { let rendered = 0; for (const [id, entry] of Object.entries(real.assets)) { @@ -43,7 +43,8 @@ test('every real slot renders as a labelled placeholder that requests nothing, o if (entry.status !== 'placeholder') { assert.match(markup, /^
]*data-asset-status="supplied"/, `${id} (${locale}) is not marked as supplied`); - assert.ok(/`); + const element = entry.kind === 'video' ? 'video' : 'picture'; + assert.ok(new RegExp(`<${element}\\b`).test(markup), `${id} (${locale}) renders no <${element}>`); assert.ok(!markup.includes('data-asset-id') && !markup.includes('role="img"'), `${id} (${locale}) keeps the placeholder box`); rendered++; continue;