MCPcopy
hub / github.com/gofiber/fiber / RebuildTree

Method RebuildTree

router.go:821–826  ·  router.go::App.RebuildTree

RebuildTree rebuilds the prefix tree from the previously registered routes. This method is useful when you want to register routes dynamically after the app has started. It is not recommended to use this method on production environments because rebuilding the tree is performance-intensive and not t

()

Source from the content-addressed store, hash-verified

819// Latest benchmark results showed a degradation from 82.79 ns/op to 94.48 ns/op and can be found in:
820// https://github.com/gofiber/fiber/issues/2769#issuecomment-2227385283
821func (app *App) RebuildTree() *App {
822 app.mutex.Lock()
823 defer app.mutex.Unlock()
824
825 return app.buildTree()
826}
827
828// buildTree build the prefix tree from the previously registered routes
829func (app *App) buildTree() *App {

Calls 3

buildTreeMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65