Skip to content

Commit

Permalink
Added performance test for SSR (not run as part of normal test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
jhsware committed Jan 29, 2020
1 parent 9a1615b commit 9db550b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/inferno-server/__tests__/performance.server.jsx
Expand Up @@ -174,6 +174,13 @@ describe('SSR Creation (JSX)', () => {
}
console.log("Timing: ", timing)
console.log("Memory delta: ", memory)

console.log("Average: ",
Math.round(timing.reduce((prev, curr, i, arr) => prev + curr / arr.length, 0) * 1000) / 1000 + "ms",
Math.round(memory.filter((i) => i.heapUsed > 0).reduce((prev, curr, i, arr) => prev + curr.heapUsed / arr.length, 0) * 10) / 10 + "kb",
Math.round(memory.reduce((prev, curr, i, arr) => prev + curr.heapUsed / arr.length, 0) * 10) / 10 + "kb"
)
console.log("(time/call – heap delta/call – heap delta overall")

expect(typeof output).toBe('string');
expect(output.length).toBeGreaterThan(1000);
Expand Down

0 comments on commit 9db550b

Please sign in to comment.