Home / Function/ Benchmark_Session_Asserted() — fiber Function Reference

Benchmark_Session_Asserted() — fiber Function Reference

Architecture documentation for the Benchmark_Session_Asserted() function in session_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  49793018_8a02_d27e_9fd9_1c15e94ecb19["Benchmark_Session_Asserted()"]
  397e6e82_749b_4ef2_9365_02be671c59f7["session_test.go"]
  49793018_8a02_d27e_9fd9_1c15e94ecb19 -->|defined in| 397e6e82_749b_4ef2_9365_02be671c59f7
  style 49793018_8a02_d27e_9fd9_1c15e94ecb19 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/session/session_test.go lines 1341–1378

func Benchmark_Session_Asserted(b *testing.B) {
	b.Run("default", func(b *testing.B) {
		app, store := fiber.New(), NewStore()
		c := app.AcquireCtx(&fasthttp.RequestCtx{})
		defer app.ReleaseCtx(c)
		c.Request().Header.SetCookie("session_id", "12356789")

		b.ReportAllocs()
		for b.Loop() {
			sess, err := store.Get(c)
			require.NoError(b, err)
			sess.Set("john", "doe")
			err = sess.Save()
			require.NoError(b, err)
			sess.Release()
		}
	})

	b.Run("storage", func(b *testing.B) {
		app := fiber.New()
		store := NewStore(Config{
			Storage: memory.New(),
		})
		c := app.AcquireCtx(&fasthttp.RequestCtx{})
		defer app.ReleaseCtx(c)
		c.Request().Header.SetCookie("session_id", "12356789")

		b.ReportAllocs()
		for b.Loop() {
			sess, err := store.Get(c)
			require.NoError(b, err)
			sess.Set("john", "doe")
			err = sess.Save()
			require.NoError(b, err)
			sess.Release()
		}
	})
}

Subdomains

Frequently Asked Questions

What does Benchmark_Session_Asserted() do?
Benchmark_Session_Asserted() is a function in the fiber codebase, defined in middleware/session/session_test.go.
Where is Benchmark_Session_Asserted() defined?
Benchmark_Session_Asserted() is defined in middleware/session/session_test.go at line 1341.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free