We could do the mochiglobal pattern eventually. 

But last time I had worried about `ets:lookup` I had measured it at less than 5 
microseconds.

Was curious and tried it again my mac laptop:

```
f(Tries), f(T), Tries = lists:seq(1,1000000), {T, ok} = timer:tc(fun() -> 
lists:foreach( fun(_) -> config:get_boolean("couchdb", "update_lru_on_read", 
false) end, Tries) end), T/1.0e6.
0.955564
```

On a linux server:
```
f(Tries), f(T), Tries = lists:seq(1,1000000), {T, ok} = timer:tc(fun() -> 
lists:foreach( fun(_) -> config:get_boolean("couchdb", "update_lru_on_read", 
false) end, Tries) end), T/1.0e6.
1.264781
```

So seems pretty small. Granted neither the laptop not the server were very 
busy, so maybe with a larger number of lock acquisitions it looks much worse.

[ Full content available at: https://github.com/apache/couchdb/pull/1593 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to