|
| 1 | +Neutral TS Examples |
| 2 | +=================== |
| 3 | + |
| 4 | +This directory contains example implementations demonstrating how to use Neutral TS template system with various programming languages and frameworks. |
| 5 | + |
| 6 | +Neutral TS is a web template system that allows using the same templates with any programming language. |
| 7 | + |
| 8 | +## Available Examples |
| 9 | + |
| 10 | +### Rust Examples |
| 11 | +- **helloworld**: Basic "Hello World" example with Rust |
| 12 | +- **pwa-actix**: PWA implementation with Actix web framework |
| 13 | +- **pwa-axum**: PWA implementation with Axum web framework |
| 14 | +- **pwa-warp**: PWA implementation with Warp web framework |
| 15 | + |
| 16 | +### Python Examples |
| 17 | +- **helloworld**: Basic "Hello World" example with Python |
| 18 | +- **helloworldipc**: Hello World with IPC integration |
| 19 | +- **pwa-flask**: PWA implementation with Flask |
| 20 | + |
| 21 | +### PHP Examples |
| 22 | +- **helloworld**: Basic "Hello World" example with PHP |
| 23 | +- **pwa**: Progressive Web App implementation |
| 24 | + |
| 25 | +### Go Examples |
| 26 | +- **helloworld**: Basic "Hello World" example with Go |
| 27 | +- **pwa**: Progressive Web App implementation |
| 28 | + |
| 29 | +### Node.js Examples |
| 30 | +- **helloworld**: Basic "Hello World" example with Node.js |
| 31 | +- **pwa-express**: PWA implementation with Express.js |
| 32 | + |
| 33 | +## Performance |
| 34 | + |
| 35 | +The examples include performance benchmarks comparing different language implementations using the same Neutral TS templates. All templates are rendered in Rust regardless of the host language. |
| 36 | + |
| 37 | +Tests performed on the PWA example for each language and have all the elements of a real case except for DB access, which does not exist in the examples. |
| 38 | + |
| 39 | +Just to give a rough idea of the performance of Neutral TS for a real-life case. |
| 40 | + |
| 41 | +The tests were performed with: CPU 6 cores 3000MHz. 32GB RAM |
| 42 | + |
| 43 | +### Rust Actix PWA cache: |
| 44 | + |
| 45 | +``` |
| 46 | +wrk http://localhost/ |
| 47 | +Running 10s test @ http://localhost/ |
| 48 | + 2 threads and 10 connections |
| 49 | + Thread Stats Avg Stdev Max +/- Stdev |
| 50 | + Latency 513.24us 120.15us 4.24ms 88.45% |
| 51 | + Req/Sec 9.67k 618.98 10.49k 75.74% |
| 52 | + 194310 requests in 10.10s, 5.71GB read |
| 53 | +Requests/sec: 19238.79 |
| 54 | +Transfer/sec: 579.10MB |
| 55 | +``` |
| 56 | + |
| 57 | +### Rust Actix PWA no cache: |
| 58 | + |
| 59 | +``` |
| 60 | +wrk http://localhost/ |
| 61 | +Running 10s test @ http://localhost/ |
| 62 | + 2 threads and 10 connections |
| 63 | + Thread Stats Avg Stdev Max +/- Stdev |
| 64 | + Latency 4.47ms 711.40us 15.31ms 67.69% |
| 65 | + Req/Sec 1.12k 98.42 1.33k 67.50% |
| 66 | + 22360 requests in 10.00s, 673.05MB read |
| 67 | +Requests/sec: 2235.33 |
| 68 | +Transfer/sec: 67.29MB |
| 69 | +``` |
| 70 | + |
| 71 | +### PHP PWA cache: |
| 72 | + |
| 73 | +Apache |
| 74 | + |
| 75 | +``` |
| 76 | +wrk http://localhost/ |
| 77 | +Running 10s test @ http://localhost/ |
| 78 | + 2 threads and 10 connections |
| 79 | + Thread Stats Avg Stdev Max +/- Stdev |
| 80 | + Latency 1.00ms 163.88us 5.69ms 83.41% |
| 81 | + Req/Sec 4.99k 214.18 5.23k 77.72% |
| 82 | + 100307 requests in 10.10s, 2.96GB read |
| 83 | +Requests/sec: 9932.04 |
| 84 | +Transfer/sec: 299.79MB |
| 85 | +``` |
| 86 | + |
| 87 | +### PHP PWA no cache: |
| 88 | + |
| 89 | +Apache |
| 90 | + |
| 91 | +``` |
| 92 | +wrk http://localhost/ |
| 93 | +Running 10s test @ http://localhost/ |
| 94 | + 2 threads and 10 connections |
| 95 | + Thread Stats Avg Stdev Max +/- Stdev |
| 96 | + Latency 4.97ms 581.76us 12.68ms 79.12% |
| 97 | + Req/Sec 1.01k 35.62 1.06k 69.50% |
| 98 | + 20098 requests in 10.01s, 606.67MB read |
| 99 | +Requests/sec: 2008.05 |
| 100 | +Transfer/sec: 60.61MB |
| 101 | +``` |
| 102 | + |
| 103 | +### Python PWA cache: |
| 104 | + |
| 105 | +Apache WSGI |
| 106 | + |
| 107 | +``` |
| 108 | +wrk http://localhost/ |
| 109 | +Running 10s test @ http://localhost/ |
| 110 | + 2 threads and 10 connections |
| 111 | + Thread Stats Avg Stdev Max +/- Stdev |
| 112 | + Latency 2.42ms 10.03ms 149.65ms 98.68% |
| 113 | + Req/Sec 3.61k 309.23 3.85k 92.93% |
| 114 | + 71292 requests in 10.00s, 2.10GB read |
| 115 | +Requests/sec: 7128.99 |
| 116 | +Transfer/sec: 214.96MB |
| 117 | +``` |
| 118 | + |
| 119 | +### Python PWA no cache: |
| 120 | + |
| 121 | +Apache WSGI |
| 122 | + |
| 123 | +``` |
| 124 | +wrk http://localhost/ |
| 125 | +Running 10s test @ http://localhost/ |
| 126 | + 2 threads and 10 connections |
| 127 | + Thread Stats Avg Stdev Max +/- Stdev |
| 128 | + Latency 5.45ms 572.12us 14.09ms 81.09% |
| 129 | + Req/Sec 0.92k 30.78 0.97k 71.50% |
| 130 | + 18343 requests in 10.01s, 553.14MB read |
| 131 | +Requests/sec: 1833.29 |
| 132 | +``` |
| 133 | + |
| 134 | +### Node.js PWA cache |
| 135 | + |
| 136 | +``` |
| 137 | +wrk http://localhost/ |
| 138 | +Running 10s test @ http://localhost/ |
| 139 | + 2 threads and 10 connections |
| 140 | + Thread Stats Avg Stdev Max +/- Stdev |
| 141 | + Latency 6.25ms 1.07ms 24.42ms 83.15% |
| 142 | + Req/Sec 803.49 92.29 0.92k 78.00% |
| 143 | + 16003 requests in 10.00s, 483.67MB read |
| 144 | +Requests/sec: 1599.85 |
| 145 | +Transfer/sec: 48.35MB |
| 146 | +``` |
| 147 | + |
| 148 | +### Node.js PWA no cache |
| 149 | + |
| 150 | +``` |
| 151 | +wrk http://localhost/ |
| 152 | +Running 10s test @ http://localhost/ |
| 153 | + 2 threads and 10 connections |
| 154 | + Thread Stats Avg Stdev Max +/- Stdev |
| 155 | + Latency 10.43ms 2.71ms 18.90ms 62.38% |
| 156 | + Req/Sec 481.53 45.26 626.00 71.50% |
| 157 | + 9589 requests in 10.00s, 289.82MB read |
| 158 | +Requests/sec: 958.49 |
| 159 | +Transfer/sec: 28.97MB |
| 160 | +``` |
| 161 | + |
| 162 | +### Go PWA cache: |
| 163 | +``` |
| 164 | +wrk http://localhost/ |
| 165 | +Running 10s test @ http://localhost/ |
| 166 | + 2 threads and 10 connections |
| 167 | + Thread Stats Avg Stdev Max +/- Stdev |
| 168 | + Latency 1.79ms 411.90us 4.33ms 67.92% |
| 169 | + Req/Sec 2.79k 89.90 2.96k 73.00% |
| 170 | + 55527 requests in 10.00s, 1.63GB read |
| 171 | +Requests/sec: 5552.46 |
| 172 | +Transfer/sec: 167.31MB |
| 173 | +``` |
| 174 | + |
| 175 | +### Go PWA no cache: |
| 176 | +``` |
| 177 | +wrk http://localhost/ |
| 178 | +Running 10s test @ http://localhost/ |
| 179 | + 2 threads and 10 connections |
| 180 | + Thread Stats Avg Stdev Max +/- Stdev |
| 181 | + Latency 5.39ms 665.07us 13.85ms 78.27% |
| 182 | + Req/Sec 0.93k 37.72 0.99k 63.00% |
| 183 | + 18530 requests in 10.00s, 558.36MB read |
| 184 | +Requests/sec: 1852.51 |
| 185 | +Transfer/sec: 55.82MB |
| 186 | +``` |
| 187 | + |
| 188 | +Links |
| 189 | +----- |
| 190 | + |
| 191 | +Neutral TS template engine. |
| 192 | + |
| 193 | +- [Template docs](https://github.com/FranBarInstance/neutralts-docs/docs/neutralts/doc/) |
| 194 | +- [Repository](https://github.com/FranBarInstance/neutralts) |
| 195 | +- [Crate](https://crates.io/crates/neutralts) |
| 196 | +- [Examples](https://github.com/FranBarInstance/neutralts-docs/tree/master/examples) |
0 commit comments