|
| 1 | +import { Box, Flex, Text, VStack } from '@devup-ui/react' |
| 2 | +import Link from 'next/link' |
| 3 | + |
| 4 | +interface Stat { |
| 5 | + value: string |
| 6 | + unit: string |
| 7 | + label: string |
| 8 | + detail: string |
| 9 | +} |
| 10 | + |
| 11 | +const STATS: Stat[] = [ |
| 12 | + { |
| 13 | + value: '2.2', |
| 14 | + unit: 'µs', |
| 15 | + label: 'Direct JNI dispatch', |
| 16 | + detail: 'Per round-trip via pooled direct ByteBuffers', |
| 17 | + }, |
| 18 | + { |
| 19 | + value: '2.9', |
| 20 | + unit: 'µs', |
| 21 | + label: 'Sync dispatch', |
| 22 | + detail: 'Length-prefixed binary wire, no JSON envelope', |
| 23 | + }, |
| 24 | + { |
| 25 | + value: '14.5', |
| 26 | + unit: 'GB/s', |
| 27 | + label: 'Streaming throughput', |
| 28 | + detail: '256 KiB chunks, 3.3× faster than v0.x', |
| 29 | + }, |
| 30 | + { |
| 31 | + value: '32', |
| 32 | + unit: '%', |
| 33 | + label: 'Async dispatch', |
| 34 | + detail: 'Daemon-attached completion + JMethodID caching', |
| 35 | + }, |
| 36 | +] |
| 37 | + |
| 38 | +export function Performance() { |
| 39 | + return ( |
| 40 | + <Flex |
| 41 | + bg="$containerBackground" |
| 42 | + flexDir="column" |
| 43 | + overflow="hidden" |
| 44 | + px="20px" |
| 45 | + py="$spacingSpacing80" |
| 46 | + > |
| 47 | + <VStack |
| 48 | + alignSelf="center" |
| 49 | + gap="40px" |
| 50 | + maxW="1280px" |
| 51 | + w="100%" |
| 52 | + > |
| 53 | + <VStack gap="16px"> |
| 54 | + <Text color="$title" typography="h3"> |
| 55 | + Microsecond dispatch, gigabyte/s streaming |
| 56 | + </Text> |
| 57 | + <Text color="$text" typography="body"> |
| 58 | + Vespera embeds your Axum router inside the JVM via JNI — zero TCP, zero |
| 59 | + JSON envelope, raw bytes end-to-end. Numbers below are measured through the |
| 60 | + real JNI boundary on AMD Ryzen 9 9950X, JDK 21. |
| 61 | + </Text> |
| 62 | + </VStack> |
| 63 | + |
| 64 | + <Flex |
| 65 | + flexDir={['column', null, null, 'row']} |
| 66 | + gap={['$spacingSpacing12', null, null, '$spacingSpacing20']} |
| 67 | + w="100%" |
| 68 | + > |
| 69 | + {STATS.map((stat) => ( |
| 70 | + <VStack |
| 71 | + key={stat.label} |
| 72 | + bg="$cardBase" |
| 73 | + borderRadius="$spacingSpacing08" |
| 74 | + flex="1" |
| 75 | + gap={['$spacingSpacing08', null, null, '$spacingSpacing12']} |
| 76 | + minH={['unset', null, null, '180px']} |
| 77 | + px={['$spacingSpacing20', null, null, '$spacingSpacing24']} |
| 78 | + py={['$spacingSpacing16', null, null, '$spacingSpacing24']} |
| 79 | + > |
| 80 | + <Flex alignItems="baseline" gap="$spacingSpacing04"> |
| 81 | + <Text |
| 82 | + color="$vesperaPrimary" |
| 83 | + typography="displaySm" |
| 84 | + > |
| 85 | + {stat.value} |
| 86 | + </Text> |
| 87 | + <Text color="$vesperaPrimary" typography="h4"> |
| 88 | + {stat.unit} |
| 89 | + </Text> |
| 90 | + </Flex> |
| 91 | + <Text color="$title" typography="titleB"> |
| 92 | + {stat.label} |
| 93 | + </Text> |
| 94 | + <Text color="$textSub" typography="bodySm"> |
| 95 | + {stat.detail} |
| 96 | + </Text> |
| 97 | + </VStack> |
| 98 | + ))} |
| 99 | + </Flex> |
| 100 | + |
| 101 | + <Text color="$caption" typography="caption"> |
| 102 | + Measured in-process on a 1 MiB binary wire round-trip; streaming throughput |
| 103 | + measured with a 64 MiB payload. Full methodology and raw runs in the{' '} |
| 104 | + <Box |
| 105 | + as={Link} |
| 106 | + color="$vesperaPrimary" |
| 107 | + href="https://github.com/dev-five-git/vespera/blob/main/libs/vespera-bridge/docs/jni-before-after-2026-06-11.md" |
| 108 | + rel="noopener noreferrer" |
| 109 | + target="_blank" |
| 110 | + textDecoration="underline" |
| 111 | + > |
| 112 | + JNI benchmark report |
| 113 | + </Box> |
| 114 | + . |
| 115 | + </Text> |
| 116 | + </VStack> |
| 117 | + </Flex> |
| 118 | + ) |
| 119 | +} |
0 commit comments