Private fork of https://github.com/awesomeWM/awesome
b9361d54c6
This makes gears.color() cache patterns in a weak table and returns that cached pattern when we get called with the same argument again. To benchmark this change, the following code was used: local time = require("socket").gettime function benchmark(func) local begin = time() local iter = 0 while time() - begin < 1 do func() iter = iter + 1 end return iter end for _, arg in pairs({ "#00aa00", "solid:#00aa00", "radial:50,50,10:55,55,30:0,#ff0000:0.5,#00ff00:1,#0000ff", "linear:1,2:3,4:0,#000000:1,#ffffff", "png:/home/psychon/Wallpaper/Bars.png", { type = "solid", color = "#00aa00" }, { type = "radial", from = { 50, 50, 10 }, to = { 55, 55, 30 }, stops = { { 0, "#ff0000" }, { 0.5, "#00ff00" }, { 1, "#0000ff" } } }, { type = "linear", from = { 1, 2 }, to = { 3, 4 }, stops = { { 0, "#000000" }, { 1, "#ffffff" } } }, { type = "png", file = "/home/psychon/Wallpaper/Bars.png" }, }) do collectgarbage("collect") print(benchmark(function() gears.color.create_pattern(arg) end), arg) end Before this change (larger numbers are better, this measures how many times we can create the given pattern per second): 29525 #00aa00 29344 solid:#00aa00 3446 radial:50,50,10:55,55,30:0,#ff0000:0.5,#00ff00:1,#0000ff 4845 linear:1,2:3,4:0,#000000:1,#ffffff 32855 png:/home/psychon/Wallpaper/Bars.png 29883 table: 0x1bb67e0 3868 table: 0x1bb6830 5339 table: 0x1bb6c60 32772 table: 0x1bb6fe0 After this change: 126188 #00aa00 125962 solid:#00aa00 125125 radial:50,50,10:55,55,30:0,#ff0000:0.5,#00ff00:1,#0000ff 125213 linear:1,2:3,4:0,#000000:1,#ffffff 113659 png:/home/psychon/Wallpaper/Bars.png 125586 table: 0x1232680 125249 table: 0x12326d0 125468 table: 0x1232b00 113711 table: 0x1232e80 As you see, this makes some cases about 35 times faster (although I have to admit that something like this can be expected from such a synthetic benchmark). Signed-off-by: Uli Schlachter <psychon@znc.in> |
||
---|---|---|
build-tests | ||
build-utils | ||
common | ||
icons | ||
lib | ||
luadoc | ||
manpages | ||
objects | ||
themes | ||
utils | ||
.gitignore | ||
AUTHORS | ||
BUGS | ||
CMakeLists.txt | ||
LICENSE | ||
Makefile | ||
PATCHES | ||
README | ||
STYLE | ||
awesome-version-internal.h.in | ||
awesome.c | ||
awesome.desktop | ||
awesome.doxygen.in | ||
awesome.h | ||
awesomeConfig.cmake | ||
awesomerc.lua.in | ||
banning.c | ||
banning.h | ||
color.c | ||
color.h | ||
config.h.in | ||
config.ld.in | ||
dbus.c | ||
dbus.h | ||
draw.c | ||
draw.h | ||
event.c | ||
event.h | ||
ewmh.c | ||
ewmh.h | ||
globalconf.h | ||
keygrabber.c | ||
keygrabber.h | ||
keyresolv.c | ||
keyresolv.h | ||
luaa.c | ||
luaa.h | ||
mouse.c | ||
mouse.h | ||
mousegrabber.c | ||
mousegrabber.h | ||
property.c | ||
property.h | ||
root.c | ||
screen.c | ||
screen.h | ||
selection.c | ||
selection.h | ||
spawn.c | ||
spawn.h | ||
stack.c | ||
stack.h | ||
strut.c | ||
strut.h | ||
systray.c | ||
systray.h | ||
xwindow.c | ||
xwindow.h |
README
awesome ======= awesome is a highly configurable, next generation framework window manager for X. Building and installation ------------------------- After extracting the dist tarball, run: make This will create a build directory, run cmake in it and build awesome. After building is finished, you can install: make install # you might need root permissions Running awesome --------------- You can directly select awesome from your display manager. If not, you can add the following line to your .xinitrc to start awesome using startx or to .xsession to start awesome using your display manager: exec awesome In order to connect awesome to a specific display, make sure that the DISPLAY environment variable is set correctly, e.g.: DISPLAY=foo.bar:1 exec awesome (This will start awesome on display :1 of the host foo.bar.) Configuration ------------- The configuration of awesome is done by creating a $XDG_CONFIG_HOME/awesome/rc.lua file. An example configuration named "awesomerc.lua.in" is provided in the source. Troubleshooting --------------- In most systems any message printed by awesome (including warnings and errors) are written to $HOME/.xsession-errors. If awesome does not start or the configuration file is not producing the desired results the user should examine this file to gain insight into the problem.